Repository navigation
feat(xodt): count words and characters under the page - #183
Merged
Merged
Conversation
Member
Author
|
Review: no Critical or Important findings. Renamed |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bar under the page in
xodtnow shows the document's word and character counts. When there is a selection, it shows the selection's counts against the totals: "Words: 3 of 79 Characters: 20 of 465". The counts are taken again when the text or the selection changes, not on every frame.As the issue asks, a word is a stretch between the Unicode word boundaries the caret moves by (the
word_rangesfrom #178) that holds a letter or a digit. Paragraphs are counted one at a time, and the character count includes spaces.These figures differ from LibreOffice's. LibreOffice counts whatever sits between spaces, so
&is a word and "right-aligned" is one word. It also adds list labels such as "•" and "1." to both figures. On the corpus the two agree ontabs.odtanddirections.odt, and the test compares those two. Ontext.odtLibreOffice reports 88 words and 472 characters, where the issue's rule gives 79 and 465;list_labels_are_not_countedanda_hyphenated_word_is_two_and_a_lone_symbol_is_nonepin that difference. DESIGN.md §7 explains it. Matching LibreOffice instead would mean changingwords::countand counting labels.The labels read "Words: …" and "Characters: …", the same form as xods' "Sum: …" and "Count: …".
thas no plural forms, so "{n} words" would read "1 words". The German is "Wörter: {words}", "Zeichen: {characters}" and "… von {total}".Closes #177