コード例 #1
0
        /// <summary>
        /// This method allow you to add word to public PluralizationService of English.
        /// If the singluar or the plural value was already added by this method, then an ArgumentException will be thrown.
        /// </summary>
        /// <param name="singular"></param>
        /// <param name="plural"></param>
        public void AddWord(string singular, string plural)
        {
            CheckArgumentNull(singular, "singular");
            CheckArgumentNull(plural, "plural");

            if (_userDictionary.ExistsInSecond(plural))
            {
                throw new ArgumentException("plural");
            }
            if (_userDictionary.ExistsInFirst(singular))
            {
                throw new ArgumentException("singular");
            }
            _userDictionary.AddValue(singular, plural);
        }