public String stem(String str){
  if (str.length() > 0) {
    char[] c=str.toCharArray();
    for (int i=0; i < c.length; i++) {
      if (!Character.isLetter(c[i]))       return "Invalid term";
    }
  }
 else {
    return "No term entered";
  }
  str=step1a(str);
  str=step1b(str);
  str=step1c(str);
  str=step2(str);
  str=step3(str);
  str=step4(str);
  str=step5a(str);
  str=step5b(str);
  return str;
}

public String stem ( String str ) { if ( str . length ( ) > 0 ) { char [ ] c = str . toCharArray ( ) ; for ( int i = 0 ; i < c . length ; i ++ ) { if ( ! Character . isLetter ( c [ i ] ) ) return "Invalid term" ; } } else { return "No term entered" ; } str = step1a ( str ) ; str = step1b ( str ) ; str = step1c ( str ) ; str = step2 ( str ) ; str = step3 ( str ) ; str = step4 ( str ) ; str = step5a ( str ) ; str = step5b ( str ) ; return str ; }
performs stemming over a given string .
