Added functionallity to handle marking of capital letters in the same way as hyphenation.#1
Added functionallity to handle marking of capital letters in the same way as hyphenation.#1kalaspuffar wants to merge 9 commits intomainfrom
Conversation
PaulRambags
left a comment
There was a problem hiding this comment.
I couldn't find a description of this functionality in the OBFL specification. Did I overlook it?
If not, please add a description of this marking of capital letters in the OBFL specification.
| private final String translationMode; | ||
| private final boolean hyphenate; | ||
|
|
||
| private final boolean markCapitalLetters; |
There was a problem hiding this comment.
You're using spaces instead of a TAB.
I won't mention this further
| * Returns true if the mark capital letters property is true, false otherwise | ||
| * @return returns true if the mark capital letters property is true | ||
| */ | ||
| public boolean shouldMarkCapitalLetters() { |
There was a problem hiding this comment.
I'd expect a name like "isMarkingCapitalLetters", as in the FormatterConfiguration.
Please don't use "should" because that is too vague.
There was a problem hiding this comment.
Hi @PaulRambags
When it comes to the naming of this function, I use the most reasonable verb. If you want another example of this use, you have it with the hyphenate function:
In the specific case, the boolean doesn't tell you if the current object is a mark capital letter. "is" as a keyword is really great for telling about a state of an object. But in this case, it tells us if we should run a specific piece of code.
The style guide of Oracle only tells you to use a relevant verb for your function names:
https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
This can be a part that we could debate what verbs are allowed in this codebase, and then I will change it. But in that change, I will go through and change all other usages of the same keywords, so we get a cohesive use.
Best regards
Daniel
| final int prime = 31; | ||
| int result = 1; | ||
| result = prime * result + (hyphenate ? 1231 : 1237); | ||
| result = prime * result + (markCapitalLetters ? 1241 : 1247); |
There was a problem hiding this comment.
1241 -> 1231; 1247 -> 1237
That is how it is done elsewhere
Besides, 1241 and 1247 are not prime numbers
|
Hi @PaulRambags I've added the OBFL PR to the description. Still under discussion. I just moved the PR to the new repository. Best regards |
8d62c84 to
5975c26
Compare
Hi @bertfrees and @PaulRambags
After reviewing the code for how the hyphenation code is implemented, I realized that it was done with an attribute, and I see no reason why capital letter marks could not be handled the same way.
This pull request adds the functionality of a new attribute for text processing. mark-capital-letters could be used to inform the formatter if the text should have capital letter marks.
From OBFL Specification mtmse/obfl#28
Please review and comment.
Best regards
Daniel