go/text/9ebee0b6c328fa2ff15a974a7af54356b254f85a cases: fixed bug in word breaking
This change fixes a bunch of title casing bugs, related to word breaking for
instance:
Input: before -> after
a..b A..B A..B (was correct), but
a.b. A.B. A.b. (was incorrect)
a**b A**B A**b (where * is in Case_Ignorable, but not in isMid, such
as \u00ad SOFT HYPHEN)
The problem was using the title casing algorithm itself on the broken words.
Title casing is relatively simple when word breaking is already done, so
the current test implements the Unicode definition of title casing given
a work break.
isCaseIgnorable and IsMid (as defined in info.go) are
now treated as two differernt categories.
The index bit is reappropriated for this purpose.
Change-Id: Iacea919fad9a8ee8259707c92e4395b8bd84b20a
Reviewed-on: https://go-review.googlesource.com/29061
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
9 files changed