Bug 111817 - Sentence case converts all letters except the first to lowercase
Summary: Sentence case converts all letters except the first to lowercase
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-15 12:43 UTC by John A. Paravantis
Modified: 2018-03-31 08:08 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John A. Paravantis 2017-08-15 12:43:17 UTC
Description:
Sentence case converts all characters except the first to lowercase, instead of just converting the first character of a sentence to uppercase.

Steps to Reproduce:
1. As an example, in the Writer, please type "the IEA Model of Short-Term Energy Security (MOSES)".
2. Click anywhere in this sentence, and select Format > Test > Sentence case.
3. Confirm that the sentence has been edited to "The iea model of short-term energy security (moses)".

Actual Results:  
The original sentence of "the IEA Model of Short-Term Energy Security (MOSES)" was converted to "The iea model of short-term energy security (moses)", which was not the intended result.

Expected Results:
The conversion of "the IEA Model of Short-Term Energy Security (MOSES)" was converted to "The iea model of short-term energy security (moses)" was erroneous, messing up the "IEA", "MOSES" and first capitals of some words.

The correct conversion would have been to "The IEA Model of Short-Term Energy Security (MOSES)", in other words only the first character of the sentence should have been edited (to uppercase), while the rest of the sentence should have been left alone.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Comment 1 John A. Paravantis 2017-08-15 12:46:30 UTC
The menu choice in Step 2 should have been

Format > Text (not Test) > Sentence case.

Apologies
Comment 2 Xisco Faulí 2017-08-15 16:58:04 UTC
Checking the documentation: https://help.libreoffice.org/Common/Change_Case#Sentence_case it says: 'Changes the first letter of the selected western characters to an uppercase character.' so I guess the documentation should also mention that it changes the rest of the sentence to lowercase...

@Olivier, what do you think?
Comment 3 John A. Paravantis 2017-08-15 17:04:59 UTC
Forgive me for butting in: In my opinion, it is not the documentation that should be changed, but the code.

The behavior of the Sentence case command should be as I describe above, which is as it is in Word 2016. Otherwise, it would be useless.
Comment 4 Olivier Hallot 2017-08-15 19:14:58 UTC
I agree with John. 

The code should touch only the first letter, not the whole sentence.
Comment 5 David 2017-08-15 21:46:16 UTC
I've used this feature when a paragraph was in all caps.  In that situation (which I've encountered several times) the sentence case worked exactly how I expected it to. So I don't consider it useless the way it is now.
Comment 6 John A. Paravantis 2017-08-15 23:04:39 UTC
I respectfully disagree with David.

If the Sentence case forces all characters but the first into lowercase, it messes up any characters that appear in capital intentionally, such as USA, John. This would be a major mess-up, requiring a lot of work on behalf of the user afterwards (as in the example I provided above).

Such a unusual Sentence case function would certainly be useless to authors of research papers, technical reports etc.

In my opinion, a paragraph in all caps should be edited to lowercase with

Format > Text > lowercase OR Cycle Case

with one step of additional editing of the first word, is Sentence case is needed.

Again, this is why Microsoft Word works like this.
Comment 7 John A. Paravantis 2017-08-16 04:59:34 UTC
If I may add this comment please, related to David's concern about an all caps paragraph: As long as the Sentence case worked like I propose (Word 2016), an ALL CAPS paragraph could be converted to Sentence case in the following steps,

(1) Select all paragraph,
(2) Format > Text > lowercase,
(3) (while paragraph that is now all lowercase is still selected) Format > Text > Sentence case.
Comment 8 Telesto 2018-01-17 17:19:31 UTC
Also in:
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 9 V Stuart Foote 2018-03-31 06:59:05 UTC
(In reply to Olivier Hallot from comment #4)
> I agree with John. 
> 
> The code should touch only the first letter, not the whole sentence.

No, Sentence case as implemented uses the ICU transliteration libraries implemented in i18n.  As does transliteration of UPPERCASE, Capitalize Every Word, and lowercase--all of which are provided via the Cycle Case (<Shift>+F3) shortcut or the Format -> Text menu which also includes the tOGGLE cASE.

These transliterations _implicitly_ affect the entire string selection, that is the way the methods works. And, I don't believe we do any modifications to the transliterations (to be able to apply our own logic to only affect initial character) we would not want to as the libraries are optimized and we depend on them for a lot of our Unicode glyph handling.

This is not the AutoCorrect "Capitalize first letter of every sentence" which is implemented in edit engine and monitors key entry for word transitions in Modify or Typing mode.

=> NOTABUG and Xisco's suggested help change is legitimate.
Comment 10 V Stuart Foote 2018-03-31 08:08:47 UTC
(In reply to V Stuart Foote from comment #9)
> This is not the AutoCorrect "Capitalize first letter of every sentence"
> which is implemented in edit engine and monitors key entry for word
> transitions in Modify or Typing mode.

And in fact, with the Capitalize first... AutoCorrect option set (it is by default), the Tools -> Autocorrect -> Apply will perform the desired change to capitalize the first letter of every sentence as needed leaving the rest of the sentence unchanged.

There is a minor glitch in this in that the paragraph must be set to Default style, see bug 59034, to correct. And then set back to preferred style if needed.