protected static Map<String,Step> parse(Class<? extends RSLPStemmerBase> clazz,String resource){
  try {
    InputStream is=clazz.getResourceAsStream(resource);
    LineNumberReader r=new LineNumberReader(new InputStreamReader(is,StandardCharsets.UTF_8));
    Map<String,Step> steps=new HashMap<>();
    String step;
    while ((step=readLine(r)) != null) {
      Step s=parseStep(r,step);
      steps.put(s.name,s);
    }
    r.close();
    return steps;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

protected static Map < String , Step > parse ( Class < ? extends RSLPStemmerBase > clazz , String resource ) { try { InputStream is = clazz . getResourceAsStream ( resource ) ; LineNumberReader r = new LineNumberReader ( new InputStreamReader ( is , StandardCharsets . UTF_8 ) ) ; Map < String , Step > steps = new HashMap < > ( ) ; String step ; while ( ( step = readLine ( r ) ) != null ) { Step s = parseStep ( r , step ) ; steps . put ( s . name , s ) ; } r . close ( ) ; return steps ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
parse a resource file into an rslp stemmer description .
