// public: public WordForm(string word, WordFormType type, WordPoliteness politeness, string optionalHint = null) { mWord = word; mType = type; mPoliteness = politeness; mOptionalHint = optionalHint; // Build descriptions bool previousCharIsLowercase = false; string typeBasedDescription = type.ToString().Substring(1); foreach (char c in typeBasedDescription) { if (char.IsUpper(c) && previousCharIsLowercase) { mDescription += ' '; } mDescription += c; previousCharIsLowercase = char.IsLower(c); } // Find TypeInfo foreach (var typeInfoPair in sTypeInfo) { if (type == typeInfoPair.Key) { mFormTypeInfo = typeInfoPair.Value; break; } } if (mFormTypeInfo == null) { throw new Exception("Missing FormTypeInfo for: " + type.ToString()); } // Always enable masu if (type == WordFormType.kPerfect && politeness == WordPoliteness.kPolite) { mEnabledWithPlainSet = true; mEnabledWithPoliteSet = true; } else { mEnabledWithPlainSet = (politeness != WordPoliteness.kPolite); mEnabledWithPoliteSet = (politeness != WordPoliteness.kPlain); } }
public bool HasOptionalWordFormTypeEnabled(WordFormType type) { return(mByWeightWordFormTypes.Contains(type)); }
public bool IsTypeAndPoliteness(WordFormType type, WordPoliteness politeness) { return((mType == type) && (mPoliteness == politeness)); }