예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PorterStemmer"/> class.
 /// </summary>
 /// <param name="language">The language code.</param>
 /// <exception cref="System.NotSupportedException">The specified language is not supported.</exception>
 public PorterStemmer(string language) {
     switch (Library.GetLang(language)) {
         case "en":
             algorithm = new English();
             break;
         case "pt":
             algorithm = new Portuguese();
             break;
         default:
             throw new NotSupportedException("The specified language is not supported.");                   
     }
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PorterStemmer"/> class.
        /// </summary>
        /// <param name="language">The language code.</param>
        /// <exception cref="System.NotSupportedException">The specified language is not supported.</exception>
        public PorterStemmer(string language)
        {
            switch (Library.GetLang(language))
            {
            case "en":
                algorithm = new English();
                break;

            case "pt":
                algorithm = new Portuguese();
                break;

            default:
                throw new NotSupportedException("The specified language is not supported.");
            }
        }