Example #1
0
        /***************************
        * Verbs
        ***************************/

        private void InitializeVerbJishoFromType()
        {
            // Only look at the last word in a line, not the whole line
            string reducedLastWord = mKana.Split(' ').Last();

            if (!reducedLastWord.EndsWith("ます"))
            {
                throw new Exception(string.Format("\"{0}\" : Does not end in ます", mKana));
            }
            if (reducedLastWord.Length == 2)
            {
                throw new Exception(string.Format("\"{0}\" : A verb can't be only ます", mKana));
            }

            reducedLastWord = reducedLastWord.Substring(0, reducedLastWord.Length - 2);

            // Special exception, Suru and Kuru are both "type 3"
            if (HasCardType(CardType.kVerbSuru) && mLastKanji == '来')
            {
                mCardTypes.Remove(CardType.kVerbSuru);
                mCardTypes.Add(CardType.kVerbKuru);
            }

            if (HasCardType(CardType.kVerbGodan))
            {
                mJishoText  = reducedLastWord.Substring(0, reducedLastWord.Length - 1);
                mJishoText += CharacterTools.ConvertKanaVowelSound(reducedLastWord.Last(), 'う');;
            }
            else
            {
                if (HasCardType(CardType.kVerbIchidan))
                {
                    mJishoText  = reducedLastWord;
                    mJishoText += 'る';
                }
                else if (HasCardType(CardType.kVerbSuru))
                {
                    mJishoText  = reducedLastWord.Substring(0, reducedLastWord.Length - 1);
                    mJishoText += "する";
                }
                else if (HasCardType(CardType.kVerbKuru))
                {
                    mJishoText = "くる";
                }
            }
        }
Example #2
0
        public string GetWordWithConvertedKana(char desiredKana)
        {
            bool forVerbUsage = true;

            return(mWord.Substring(0, mWord.Count() - 1) + CharacterTools.ConvertKanaVowelSound(mWord.Last(), desiredKana, forVerbUsage));
        }