protected synchronized ptstemmer . Stemmer getActualStemmer ( ) throws PTStemmerException { if ( m_ActualStemmer == null ) { // stemmer algorithm if ( m_Stemmer == STEMMER_ORENGO ) m_ActualStemmer = new OrengoStemmer ( ) ; else if ( m_Stemmer == STEMMER_PORTER ) m_ActualStemmer = new PorterStemmer ( ) ; else if ( m_Stemmer == STEMMER_SAVOY ) m_ActualStemmer = new SavoyStemmer ( ) ; else throw new IllegalStateException ( "Unhandled stemmer type: " + m_Stemmer ) ; // named entities if ( ! m_NamedEntities . isDirectory ( ) ) m_ActualStemmer . ignore ( PTStemmerUtilities . fileToSet ( m_NamedEntities . getAbsolutePath ( ) ) ) ; // stopwords if ( ! m_Stopwords . isDirectory ( ) ) m_ActualStemmer . ignore ( PTStemmerUtilities . fileToSet ( m_Stopwords . getAbsolutePath ( ) ) ) ; // cache if ( m_Cache > 0 ) m_ActualStemmer . enableCaching ( m_Cache ) ; else m_ActualStemmer . disableCaching ( ) ; } return m_ActualStemmer ; }
Returns the stemmer to use .