Package org.apache.commons.codec.language

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


    params.set("selectedField", "1"); // tweet
    params.set("groupByField", "0"); // username
    ByKeyGroupingJob.startJob(params);
    DoubleMetaphone filter = new DoubleMetaphone();
// TODO: change these terms?!
    System.out.println(filter.encode("Loke"));
    System.out.println(filter.encode("companymancomic"));
    System.out.println(filter.encode("webcomics"));
    System.out.println(filter.encode("@comic"));
  }
}
View Full Code Here


    params.set("groupByField", "0"); // username
    ByKeyGroupingJob.startJob(params);
    DoubleMetaphone filter = new DoubleMetaphone();
// TODO: change these terms?!
    System.out.println(filter.encode("Loke"));
    System.out.println(filter.encode("companymancomic"));
    System.out.println(filter.encode("webcomics"));
    System.out.println(filter.encode("@comic"));
  }
}
View Full Code Here

    ByKeyGroupingJob.startJob(params);
    DoubleMetaphone filter = new DoubleMetaphone();
// TODO: change these terms?!
    System.out.println(filter.encode("Loke"));
    System.out.println(filter.encode("companymancomic"));
    System.out.println(filter.encode("webcomics"));
    System.out.println(filter.encode("@comic"));
  }
}
View Full Code Here

    DoubleMetaphone filter = new DoubleMetaphone();
// TODO: change these terms?!
    System.out.println(filter.encode("Loke"));
    System.out.println(filter.encode("companymancomic"));
    System.out.println(filter.encode("webcomics"));
    System.out.println(filter.encode("@comic"));
  }
}
View Full Code Here

      PPSearchPath searchPath) {
    if(currentName.getSegmentCount() < 2)
      return new String[0];

    final DoubleMetaphone encoder = new DoubleMetaphone();
    final String metaphoneName = encoder.encode(currentName.getLastSegment());

    Collection<String> proposals = generateAttributeCandidates(currentName, descs, searchPath);
    // propose all, but sort them based on likeness

    String[] result = new String[proposals.size()];
View Full Code Here

    // compute the 5 best matches and only accept if score <= 5
    ScoreKeeper<IEObjectDescription> tracker = new ScoreKeeper<IEObjectDescription>(5, false, 5);
    // List<IEObjectDescription> metaphoneAlike = Lists.newArrayList();
    final DoubleMetaphone encoder = new DoubleMetaphone();
    final String metaphoneName = encoder.encode(currentName);

    for(IEObjectDescription d : descs) {
      EClass c = d.getEClass();
      typeok: if(types != null && types.length > 0) {
        for(EClass wanted : types)
View Full Code Here

      if(searchPath.searchIndexOf(d) == -1)
        continue; // not visible according to path

      String candidateName = converter.toString(d.getName());
      tracker.addScore(StringUtils.getLevenshteinDistance(currentName, candidateName), d);
      String candidateMetaphone = encoder.encode(candidateName);
      // metaphone matches are scored on the pronounciation distance
      if(metaphoneName.equals(candidateMetaphone) //
          ||
          candidateMetaphone.startsWith(metaphoneName) //
          || candidateMetaphone.endsWith(metaphoneName) //
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.