public void IncludeExplicitPhonesWithoutDiacritics() { m_cache.AddPhone("a"); m_cache.AddPhone("b"); m_cache.AddPhone("c"); m_cache.AddPhone("e"); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("e", CVPatternInfo.PatternType.Custom)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("c", CVPatternInfo.PatternType.Custom)); Assert.AreEqual("VCec", m_cache.GetCVPattern("abec")); Assert.AreEqual("CceV", m_cache.GetCVPattern("bcea")); Assert.AreEqual("eVCc", m_cache.GetCVPattern("eabc")); }
public void IncludeExplicitPhonesWithDiacritics() { m_cache.AddPhone("a"); m_cache.AddPhone("a\u0303"); m_cache.AddPhone("b"); m_cache.AddPhone("c"); m_cache.AddPhone("e"); m_cache.AddPhone("e\u0301"); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("e\u0301", CVPatternInfo.PatternType.Custom)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("a", CVPatternInfo.PatternType.Custom)); Assert.AreEqual("aCe\u0301C", m_cache.GetCVPattern("abe\u0301c")); Assert.AreEqual("CCVV", m_cache.GetCVPattern("bcea\u0303")); Assert.AreEqual("e\u0301aCC", m_cache.GetCVPattern("e\u0301abc")); }
public void IncludeExplicitDiacriticsBefore() { m_cache.AddPhone("a"); m_cache.AddPhone("b"); m_cache.AddPhone("\u207Fb"); m_cache.AddPhone("c"); m_cache.AddPhone("e"); _prj.AddAmbiguousSequence("\u207Fb"); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("a", CVPatternInfo.PatternType.Custom)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("\u207F" + App.DottedCircle, CVPatternInfo.PatternType.Custom)); Assert.AreEqual("a\u207FCVC", m_cache.GetCVPattern("a\u207Fbec")); Assert.AreEqual("\u207FCCVa", m_cache.GetCVPattern("\u207Fbcea")); Assert.AreEqual("aV\u207FCC\u207FC", m_cache.GetCVPattern("ae\u207Fbc\u207Fb")); }
public void IncludeExplicitDiacriticsAfter() { m_cache.AddPhone("a"); m_cache.AddPhone("a\u0303"); m_cache.AddPhone("b"); m_cache.AddPhone("c"); m_cache.AddPhone("e"); m_cache.AddPhone("e\u0301"); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("\u0301", CVPatternInfo.PatternType.Suprasegmental)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("a", CVPatternInfo.PatternType.Custom)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create(App.DottedCircle + "\u0303", CVPatternInfo.PatternType.Custom)); Assert.AreEqual("aCVC", m_cache.GetCVPattern("abec")); Assert.AreEqual("CCV\u0301a", m_cache.GetCVPattern("bce\u0301a")); Assert.AreEqual("aV\u0301CV\u0303C", m_cache.GetCVPattern("ae\u0301ba\u0303c")); }
/// ------------------------------------------------------------------------------------ private IEnumerable <CVPatternInfo> GetCurrentSymbolsToDisplayInPatterns() { // First build a list of the checked symbols var list = _cvPatternSymbolExplorer.GetTextsOfAllCheckedItems() .Select(symbol => CVPatternInfo.Create(symbol, CVPatternInfo.PatternType.Suprasegmental)).ToList(); // Now add to the list of checked symbols, the list of custom segments entered. var split = txtCustomChars.Text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); foreach (var seg in split.Select(p => p.Replace(App.DottedCircle, string.Empty)) .Where(s => s != string.Empty && !list.Any(c => c.Phone == s)) .Distinct(StringComparer.Ordinal)) { list.Add(CVPatternInfo.Create(seg, CVPatternInfo.PatternType.Custom)); } return(list); }
public void IncludeExplicitDiacriticsOnBothSides() { m_cache.AddPhone("a"); m_cache.AddPhone("a\u0303"); m_cache.AddPhone("b"); m_cache.AddPhone("\u207Fb"); m_cache.AddPhone("c"); m_cache.AddPhone("e"); _prj.AddAmbiguousSequence("\u207Fb"); _prj.CVPatternInfoList.Add(CVPatternInfo.Create(App.DottedCircle + "\u0303", CVPatternInfo.PatternType.Custom)); _prj.CVPatternInfoList.Add(CVPatternInfo.Create("\u207F" + App.DottedCircle, CVPatternInfo.PatternType.Custom)); Assert.AreEqual("VV\u0303\u207FCC", m_cache.GetCVPattern("ea\u0303\u207Fbc")); Assert.AreEqual("\u207FCCVV", m_cache.GetCVPattern("\u207Fbcea")); Assert.AreEqual("CV\u0303CV", m_cache.GetCVPattern("ba\u0303ce")); Assert.AreEqual("VCV\u207FC", m_cache.GetCVPattern("eca\u207Fb")); }