-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the order in which patterns are run.
Previously patterns have been run in the order they are defined in the pattern file with general patterns run first, then script patterns, then language patterns and finally country patterns. Change this so that patterns with the same name are always run one after the other in the position of the earliest one. For example, consider the following patterns defined in the pattern files in the following order. Latn.common-error: A, B, C Latn-fi.common-error: B, D, E Previously these were run in order A, B, C, B, D, E. With this change they will now be run in order A, B, B, C, D, E or if the policy of the B pattern in Latn-fi has been set to 'Replace', the A, B, C, D, E. This should make it more convenient to replace or extend patterns above in the hierarchy. Adapt Latn-fr.common-error.in to the above order and add Latn-fi.common-error.in to use the new order.
- Loading branch information
Showing
5 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<patterns> | ||
<pattern name="Space after punctuation marks" enabled="true"/> | ||
</patterns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Common Error Pattern] | ||
_Name=Space after punctuation marks | ||
_Description=Add space after various punctuation marks | ||
Classes=Human;OCR; | ||
# Same as the Latin pattern, except no space after colon to accommodate | ||
# Finnish suffixes, e.g. 'TV:ssä'. | ||
Pattern=((\w|^|["'«»])[,;?!])(?!["'«»])([^\W\d][\w\s]) | ||
Flags=DOTALL;MULTILINE;UNICODE; | ||
Replacement=\1 \3 | ||
Repeat=False | ||
Policy=Replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters