Skip to content

Conversation

benjaminking
Copy link
Collaborator

@benjaminking benjaminking commented Sep 4, 2025

This PR adds a class that can detect the quote convention for a Paratext project from a project directory. This class will primarily be used by SILNLP to detect the quote convention for the source and target projects.


This change is Reviewable

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Enkidu93 reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion


machine/corpora/file_paratext_project_quote_convention_detector.py line 18 at r1 (raw file):

        return (Path(self._project_dir) / file_name).exists()

    def _open(self, file_name: str) -> Optional[BinaryIO]:

I don't think this method can ever return None, so you don't need Optional. Also, you should use StrPath rather than str consistently here to match the other file_... implementation classes.

@Enkidu93
Copy link
Collaborator

Enkidu93 commented Sep 8, 2025

(Just remembering that this isn't in yet - https://reviewable.io/reviews/sillsdev/silnlp/806#-OZdHeea77ETxx9aywUn. As soon as this is in, I can release a new machine.py version)

@Enkidu93 Enkidu93 requested a review from ddaspit September 8, 2025 12:47
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.11%. Comparing base (146f195) to head (20f7897).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #224   +/-   ##
=======================================
  Coverage   91.11%   91.11%           
=======================================
  Files         333      333           
  Lines       21706    21706           
=======================================
  Hits        19778    19778           
  Misses       1928     1928           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator Author

@benjaminking benjaminking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ddaspit and @Enkidu93)


machine/corpora/file_paratext_project_quote_convention_detector.py line 18 at r1 (raw file):

Previously, Enkidu93 (Eli C. Lowry) wrote…

I don't think this method can ever return None, so you don't need Optional. Also, you should use StrPath rather than str consistently here to match the other file_... implementation classes.

Done.

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@Enkidu93 reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ddaspit)

@benjaminking benjaminking merged commit 2afbd4e into main Sep 8, 2025
14 checks passed
@benjaminking benjaminking deleted the detect_quote_convention_for_file_pt_proj branch September 8, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants