Files
odfstudio/lingucomponent
László Németh f9f694f5d9 tdf#173389 sw: add compound-based “smart” hyphenation for readability
As a natural extension of the "smart" hyphenation, following
traditional typography, prefer readability of the hyphenated
compound words and better word spacing in the following way:

* when it's possible to hyphenate the same compound word within
  the custom word spacing range, choose compound splitting or
  hyphenate just before the suffix or inside the suffix, not
  inside a compound constituent.

* limit plain, i.e. non-compound-based smart hyphenation, when
  it can results in better word spacing without losing readability:
  do not disable hyphenation within the custom word spacing range, if
  the hyphenation splits the compound word between its constituents;

* if also shrinking results in a non-compound splitting hyphenation
  inside the second or third etc. constituent of a compound word,
  always shrink the line to show bigger part of that non-first
  constituent (within the custom word spacing range).

For these, extend lingucomponent HYPH_COMPOUND_MIN_LEADING and
HYPH_COMPOUND_MIN_TRAILING API to support disabling hyphenation of
non-compound words, also disabling hyphenation inside the first
constituent (but not inside the suffix or just before the suffix).
This allows to recognize compound words during line breaking.
Details: Hyphenator::hyphenate().

The initial development enables compound-based "smart" hyphenation
only for the Hungarian language, yet. The patch contains minor
fixes of the compound-based Hungarian hyphenation, resulting
better compound-based "smart" hyphenation with recognition of
verb prefixes and leg-/legesleg- superlative prefixes. (Note:
this fixed also COMPOUND_MIN_LEADING/TRAILING settings for the
hyphenation of the compound words with dictionary-based hyphenation
(only hy:, without pa: Hunspell dictionary fields, i.e. without
compound splitting heuristics of Hunspell).

Change-Id: I26f31329cdea20f03dbde7742587089eb5df5ae2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210423
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2026-09-04 09:40:40 +02:00
..
…
…

Linguistics Components

lingucomponent contains spellcheck, hyphenator, thesaurus, etc.