public void Rules_JShumn() { string word = "бойкий"; string result = Syllables.Rules(word); Assert.AreEqual("бой-кий", result); }
public void Rules_DoubleShumn() { string word = "такса"; string result = Syllables.Rules(word); Assert.AreEqual("та-кса", result); }
public void Rules_GlasnSonornGlasn() { string word = "око"; string result = Syllables.Rules(word); Assert.AreEqual("о-ко", result); }
public void Rules_ShumnAfterGlasn() { string word = "роса"; string result = Syllables.Rules(word); Assert.AreEqual("ро-са", result); }
public void Rules_DoubleLetter() { string word = "масса"; string result = Syllables.Rules(word); Assert.AreEqual("ма-сса", result); }
public void Rules_SonornAfterJ() { string word = "стойло"; string result = Syllables.Rules(word); Assert.AreEqual("стой-ло", result); }
public void Rules_OneSlog() { string word = "слог"; string result = Syllables.Rules(word); Assert.AreEqual("слог", result); }
public void Rules_GlasnAfterGlasn() { string word = "диалог"; string result = Syllables.Rules(word); Assert.AreEqual("ди-а-лог", result); }
public void Rules_SonornSonorn() { string word = "полный"; string result = Syllables.Rules(word); Assert.AreEqual("по-лный", result); }
public void Rules_UnknownSymbol_NorLetterNorHyphren() { string word = "сло8о"; string result = Syllables.Rules(word); Assert.AreEqual("сло8-о", result); }
public void Rules_ContainsHyphren_NoGlasn() { string word = "зачем-то"; string result = Syllables.Rules(word); Assert.AreEqual("за-чем-то", result); }
public void Rules_GlasnShumnSonorn() { string word = "весна"; string result = Syllables.Rules(word); Assert.AreEqual("ве-сна", result); }
public void Rules_UnknownSymbol_Sonorn() { string word = "слмъово"; string result = Syllables.Rules(word); Assert.AreEqual("слмъо-во", result); }
public void Rules_UnknownSymbol_NoSonorn() { string word = "вьюга"; string result = Syllables.Rules(word); Assert.AreEqual("вью-га", result); }
public void Divide_SeveralWords() { string word = "слог слово"; string result = Syllables.DivideText(word); Assert.AreEqual("слог сло-во ", result); }
public void Rules_ContainsHyphren_GlasnSlog() { string word = "как-то"; string result = Syllables.Rules(word); Assert.AreEqual("как-то", result); }
public void PrintSlog_firstPrintedfalse_cut0() { string result = ""; StringBuilder slog = new StringBuilder("тест"); bool firstPrinted = false; slog = Syllables.PrintSlog(slog, ref result, ref firstPrinted); Assert.AreEqual("", slog.ToString()); Assert.AreEqual("тест", result); }
public LookupWordViewModel(string word, Syllables syllables, Pronunciation pronunciation) { _wordDisplay = word; if (syllables?.List?.Length > 0) { foreach (var syllable in syllables.List) { _syllableDisplay += syllable + "·"; } _syllableDisplay = _syllableDisplay[0..^ 1];
public void PrintSlog_firstPrintedtrue_cut2() { string result = ""; StringBuilder slog = new StringBuilder("тест"); bool firstPrinted = true; slog = Syllables.PrintSlog(slog, ref result, ref firstPrinted, 2); Assert.AreEqual("ст", slog.ToString()); Assert.AreEqual("-те", result); }
public string getSpellingText(string text) { SyllableLibrary syllble = new SyllableLibrary(); Syllables ss = syllble.GetSyllableWords(text); string newText = ""; foreach (var hece in ss) { if (newText.Equals("")) { newText = hece.Value; } else { newText += "-" + hece.Value; } } return(newText); }
static void Main(string[] args) { SyllableLibrary syllble = new SyllableLibrary(); Syllables ss = syllble.GetSyllableWords("şebinkarahisarlılar"); }
public int TotalVowels() { return(Syllables.Sum(each => each.CountPhonemeVowels())); }
public Syllables GetSyllableWords(string word) { Syllables result = new Syllables(); Syllable tempWord = new Syllable(); word = word.ToLower().Trim(); bool lastWasVowel = false; var vowels = new[] { 'a', 'e', 'i', 'ı', 'o', 'ö', 'u', 'ü' }; tempWord.Value = ""; string tempSyllable = ""; List <int> wordPosition = new List <int>(); for (int i = 0; i < word.Length; i++) { char tempKey = word[i]; if (vowels.Contains(tempKey)) { tempSyllable = ""; } else { tempSyllable += tempKey; if (tempSyllable.Length > 1) { wordPosition.Add(i - 1); } } } wordPosition.Add(word.Length - 1); for (var i = 0; i < wordPosition.Count; i++) { string innerWord = word.Substring( i == 0 ? 0 : wordPosition[i - 1] + 1, i == 0 ? wordPosition[i] + 1 : wordPosition[i] - wordPosition[i - 1]); tempWord = new Syllable(); foreach (var c in innerWord) { tempWord.Value += c; if (vowels.Contains(c)) { if (!lastWasVowel) { result.Add(tempWord); tempWord = new Syllable(); } lastWasVowel = true; } else { lastWasVowel = false; } } if (tempWord?.Value?.Length > 0) { try { result.Last().Value += tempWord.Value; } catch (Exception ex) { Console.WriteLine(ex.Message); } } } return(result); }
public void TestPronunciation() { PronunciationEngine.GetPhoneticsWord("fish").Should().NotBeNull(); PronunciationEngine.GetPhoneticsWord("fish") !.Syllables.Should().NotBeEmpty(); }
public Lyrics(SyllableType type, string text, double?defaultY) { Syllables.Add(new Syllable(type, text)); defaultYPosition = defaultY; }
public override string ToString() { var symbols = string.Join(".", Syllables.Select(s => string.Join("", s.Phonemes.Select(p => p.Symbol)))); return($"/{symbols}/"); }