Package org.apache.commons.codec.language

Examples of org.apache.commons.codec.language.Metaphone.encode()


    Metaphone codec = new Metaphone();
    String phrase = "";
    String encoded = "";
    for(String s : args) {
      phrase += s.toUpperCase() + " ";
      encoded += codec.encode(s) + " ";
    }
   
    System.out.println("PHRASE =" + phrase);
    System.out.println("ENCODED=" + encoded);
  }
View Full Code Here


    Metaphone metaphoneCodec = new Metaphone();
    List<String> encodedTokens = new ArrayList<String>();

    List<String> tokens = tokenize(plainText);
    for(String token : tokens) {
      encodedTokens.add(metaphoneCodec.encode(token));
    }
   
    String metaphone = join(encodedTokens, " ");
    byte[] base64 = Base64.encodeBase64Chunked(metaphone.getBytes());
    return new String(base64);
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.