-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
title case may be no right when the en-dash exist in title #9068
Comments
Thanks for the feedback, currently JabRef does only check words separated by whitespace if I understand the code correctly. No dashes or other characters are considered. I think it should be easy to adapt it to consider words directly following a dash as well. One needs to check if the current char is a dash as well. The TitleParser splits words by whitepace: jabref/src/main/java/org/jabref/logic/formatter/casechanger/TitleParser.java Lines 23 to 39 in bb011c9
|
Hi. Can you describe to me, step by step, how do I reach this part of the JabRef you talking about? I wanna help coding this issue. Thanks ;) |
Changing this to ALWAYS capitalize might be wrong as well, if following certain grammars or citationstyles:
Refs. https://english.stackexchange.com/questions/26964/capitalization-of-words-with-dashes-in-titles But to be honest ... does it really matter? Just make "capitalize" to make it all capital, including after a dash. That's it. These Grammars are too complicated. Grammars should make live easier, not more complicated... |
Agree with Thilo. We capitalize the word after the dash always. @zousiyu1995 Codewise take a look at the TitleCaseFormatter and the corresponding test. Add an example with a dash to the test case so you can directly check if your code works |
Also hyphen (U+2010) en-dash (U+2013), em-dash (U+2014) and possibly other dash-like characters. I have also encountered the minus sign (U+2212) used as a hyphen. Some of these characters may be surrounded by zero width spaces. These will probably be recognized as white spaces—I am not sure about Java—but can still cause unexpected results if, for example, you write a regular expression that relies on a specific number of characters. Likewise, the input string may contain one or more unexpected (visible) spaces, as in "Non -protein elements". |
Those of use who think so choose sentence case whenever possible! Eager capitalization is a good choice for title case. |
One more question, what should I do about the words with two or more hyphens? Like "brother-in-law", "face-to-face", etc. And how should I handle wrong words like "computer--based", or it never happens? |
Could the "simple rule" be: |
What do you mean by equivalent of a period? Found this guide https://www.thepunctuationguide.com/em-dash.html |
Your guide is right about the detailed rules, but I believe it will be difficult (and not that useful) to develop an algorithm that matches the cases. |
When the en-dash exist in the title, see bolded part,
I run the "title case" and noticed that the initial letter of the word after the en-dash is lowercased (jabref generated Enzyme-catalyzed), is this correct?
I want it to be capitalized (what i want is Enzyme-Catalyzed). Is this possible?
full bib text is shown as following,
The text was updated successfully, but these errors were encountered: