本文整理了Java中org.apache.commons.codec.language.Metaphone.setMaxCodeLen()
方法的一些代码示例,展示了Metaphone.setMaxCodeLen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metaphone.setMaxCodeLen()
方法的具体详情如下:
包路径:org.apache.commons.codec.language.Metaphone
类名称:Metaphone
方法名:setMaxCodeLen
[英]Sets the maxCodeLen.
[中]设置maxCodeLen。
代码示例来源:origin: commons-codec/commons-codec
@Test
public void testSetMaxLengthWithTruncation() {
// should be AKSKS, but istruncated by Max Code Length
this.getStringEncoder().setMaxCodeLen( 6 );
assertEquals( "AKSKSK", this.getStringEncoder().metaphone("AXEAXEAXE") );
}
代码示例来源:origin: Simmetrics/simmetrics
/**
* Creates an instance of the Metaphone simplifier with a
* {@code maxCodeLength}. All encodings will have at most
* {@code maxCodeLength} characters.
*
* @param maxCodeLength
* maximum length of the encoding
*/
public Metaphone(int maxCodeLength) {
this.simplifier = new org.apache.commons.codec.language.Metaphone();
this.simplifier.setMaxCodeLen(maxCodeLength);
}
代码示例来源:origin: stackoverflow.com
Metaphone meta = new Metaphone();
meta.setMaxCodeLen(8);
System.out.println(meta.isMetaphoneEqual("cricket","criket"));
System.out.println(meta.isMetaphoneEqual("cricket","criketgame"));
内容来源于网络,如有侵权,请联系作者删除!