divvun/libdivvun

withCasing uses getCasing(cohort wf), should use getCasing(whole_underlined_wf)

Closed this issue · 0 comments

If the suggestion/underline covers more than one cohort, we need to use the casing from that whole string, not just the cohort of the reading with the error tag.

If input is

"<A.>"
	"A" N Sg <NoSpaceAfterPunctMark> &no-space-after-punct-mark ID:1 R:RIGHT:2
	"A" N Sg <NoSpaceAfterPunctMark> "<A. Eira>" &no-space-after-punct-mark &SUGGESTWF ID:1 R:RIGHT:2
"<Eira>"
	"Eira" N Prop &LINK &no-space-after-punct-mark ID:2

we want &SUGGESTWF to produce A. Eira (as if it had the <fixedcase> tag).

But

	if(r.suggestwf) {
		r.sforms.emplace_back(withCasing(r.fixedcase, inputCasing, r.wf));
	}

gets called with inputCasing that's set by inputCasing = getCasing("A.") which is considered uppercase, should be called with getCasing("A.Eira") which is mIxed (and leads to no case change).