-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better French book abbreviation handling #606
Conversation
…fter book abbreviation, and enforce always putting a space between abbreviation and number (rather than sometimes a nnbsp).
"jud" or "ju" => "Jd", | ||
"re" or "rév" or "rev" => "Ap", | ||
_ => m.Value | ||
var correctedValue = m.Value.Trim().Replace(".", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does French not use periods for abbreviations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want any periods after the abbreviation, just a space. Sometimes the AI would put one and then my replacement logic wouldn't pick it up. So now the regex will pick up a period that's directly after the book name as well (e.g. "Ex. 32.17–18" would match "Ex. " whereas before it wouldn't have matched).
}); | ||
|
||
return Task.FromResult(text); | ||
} | ||
|
||
[GeneratedRegex(@"(?:\d+[^\S\r\n])?([a-zA-Zà-üÀ-Ü]+)(?=[^\S\r\n|\.]\d+)")] | ||
[GeneratedRegex(@"(?:\d+[^\S\r\n])?([a-zA-Zà-üÀ-Ü]+\.?[^\S\r\n]?)(?=[^\S\r\n]?\d+)")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main difference here is that this now captures the period if present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It matches a period as well as any whitespace. So if it separates the book and verse by a non breaking space I can replace it with a regular space.
No description provided.