Examples of PorterStemmer


Examples of ch.akuhn.hapax.corpus.PorterStemmer

        }
        return tdm;
    }

    public TermDocumentMatrix stem() {
        return stem(new PorterStemmer());
    }
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.snowball.PorterStemmer


public class PorterStemmerTest extends TestCase {

  public void testShort() {
    PorterStemmer stemmer = new PorterStemmer();
   
    MutableString s = new MutableString();
    s.append( 's' );
    stemmer.processTerm( s );
    assertEquals( "s", s.toString() );

    s.append( 's' );
    stemmer.processTerm( s );
    assertEquals( "ss", s.toString() );

 
    s.length( 0 );

    s.append( 'S' );
    stemmer.processTerm( s );
    assertEquals( "s", s.toString() );

    s.append( 's' );
    stemmer.processTerm( s );
    assertEquals( "ss", s.toString() );

  }
View Full Code Here

Examples of kea.stemmers.PorterStemmer

    //    or other languages as specified in your "skos" vocabulary
    ke.setDocumentLanguage("en"); // es for Spanish, fr for French
   
    // Stemmer -- adjust if you use a different language than English or want to alterate results
    // (We have obtained better results for Spanish and French with NoStemmer)
    ke.setStemmer(new PorterStemmer());
   
    // Stopwords
    ke.setStopwords(new StopwordsEnglish());

    // Number of Keyphrases to extract
View Full Code Here

Examples of maui.stemmers.PorterStemmer

   * like stemmer, stopwords.
   * @throws Exception
   */
  private void setGeneralOptions()  {
    modelBuilder.setDebug(true);
    modelBuilder.setStemmer(new PorterStemmer());
    modelBuilder.setStopwords(new StopwordsEnglish());
    modelBuilder.setDocumentLanguage("en");
    modelBuilder.setMaxPhraseLength(5);
    modelBuilder.setWikipedia(wikipedia);
   
    topicExtractor.setDebug(true);
    topicExtractor.setStemmer(new PorterStemmer());
    topicExtractor.setStopwords(new StopwordsEnglish());
    topicExtractor.setDocumentLanguage("en");
    topicExtractor.setNumTopics(10);
    topicExtractor.setWikipedia(wikipedia);
  }
View Full Code Here

Examples of org.exist.util.PorterStemmer

      LOG.debug("using simple tokenizer");
      tokenizer = new SimpleTokenizer();
    }

    if (stem)
      {stemmer = new PorterStemmer();}
    tokenizer.setStemming(stem);
    if ((stopword = (String) config.getProperty(PROPERTY_STOPWORD_FILE)) != null) {
      try {
        final FileReader in = new FileReader(stopword);
        final StreamTokenizer tok = new StreamTokenizer(in);
View Full Code Here

Examples of org.tartarus.snowball.ext.PorterStemmer

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
    Stemmer stemmer = new Stemmer(new PorterStemmer());
   
    List<File> files = FileTools.getFilesFromDirectoryByName(new File("/home/ptc24/newows/reactnewpubmed"), "scrapbook.xml");

    List<Event> events = new ArrayList<Event>();
   
View Full Code Here

Examples of org.tartarus.snowball.ext.PorterStemmer

    //System.out.println(System.currentTimeMillis() - time);
  }
 
  public void run(List<File> files) throws Exception {
   
    Stemmer st = new Stemmer(new PorterStemmer());
   
    long time = System.currentTimeMillis();
    for(File f : files) {
      ProcessingDocument procDoc = ProcessingDocumentFactory.getInstance().makeTokenisedDocument(new Builder().build(f), false, false, false);
      Set<Integer> tokSet = new HashSet<Integer>();
View Full Code Here

Examples of org.tartarus.snowball.ext.PorterStemmer

   * @param args
   */
  public static void main(String[] args) throws Exception {   
    Map<String,ClassificationEvaluator> evals = new HashMap<String,ClassificationEvaluator>();
   
    Stemmer st = new Stemmer(new PorterStemmer());
   
    //String docNo = "b600383d";

    //File acDir = new File("/home/ptc24/annot_challenges/subtypes_for_lrec_crb/");
    //File acDir = new File("/home/ptc24/annot_challenges/reacttypes_crb_28082008_easy/");
View Full Code Here

Examples of org.tartarus.snowball.ext.PorterStemmer

/**
* Wrapper for the default stemmer used by this project.
*/
public class Stemmer {
  public String stem(String input) {
    PorterStemmer state = new PorterStemmer();
    state.setCurrent(input);
    state.stem();
    return state.getCurrent();
  }
View Full Code Here

Examples of org.tartarus.snowball.ext.porterStemmer

    /**
     * {@inheritDoc}
     */
    public String stem(String token) {
        porterStemmer stemmer = new porterStemmer();
        stemmer.setCurrent(token);
        stemmer.stem();
        return stemmer.getCurrent();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.