Package it.unimi.dsi.mg4j.index.snowball

Source Code of it.unimi.dsi.mg4j.index.snowball.PorterStemmerTest

package it.unimi.dsi.mg4j.index.snowball;

import junit.framework.TestCase;
import it.unimi.dsi.lang.MutableString;
import 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() );

  }
}
TOP

Related Classes of it.unimi.dsi.mg4j.index.snowball.PorterStemmerTest

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.