Skip to content

Commit 73cd3ec

Browse files
committed
Merge branch 'master' into LT-22121
2 parents 81ae11a + 7fd440c commit 73cd3ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/SIL.LCModel/DomainServices/AnalysisGuessServices.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,25 @@ private IWfiWordform GetOriginalCaseWordform(AnalysisOccurrence occurrence, int
849849
return GetWordformIfNeeded(tssWfBaseline.Text, ws);
850850
}
851851

852+
// <summary>
853+
// Get the lowercase form of occurrence if it is Title case.
854+
// </summary>
855+
private string GetLowercaseOfTitleCase(AnalysisOccurrence occurrence, int ws, bool onlyIndexZeroLowercaseMatching)
856+
{
857+
// TODO: make it look for the first word in the sentence...may not be at Index 0!
858+
if (occurrence == null)
859+
return null;
860+
if (onlyIndexZeroLowercaseMatching && occurrence.Index != 0)
861+
return null;
862+
if (occurrence.Segment == null || !occurrence.Segment.IsValidObject)
863+
return null;
864+
ITsString tssWfBaseline = occurrence.BaselineText;
865+
var cf = new CaseFunctions(Cache.ServiceLocator.WritingSystemManager.Get(ws));
866+
if (cf.StringCase(tssWfBaseline.Text) == StringCaseStatus.title)
867+
return cf.ToLower(tssWfBaseline.Text);
868+
return null;
869+
}
870+
852871
/// <summary>
853872
/// Get a wordform for word if it already exists or
854873
/// if it has an entry in the lexicon.

0 commit comments

Comments
 (0)