Class FuzzySearch.DistanceTypeConfig

java.lang.Object
com.nefrock.edgeocr.FuzzySearch.DistanceTypeConfig
Enclosing class:
FuzzySearch

public static class FuzzySearch.DistanceTypeConfig extends Object
距離計算に使用するアルゴリズムとそのパラメータをまとめた設定クラスです。

距離タイプごとに必要なパラメータが異なります:

使用例:

 // 編集距離を使用する場合
 new FuzzySearch(DistanceTypeConfig.editDistance())

 // 貪欲距離(部分一致、サイズ3)を使用する場合
 new FuzzySearch(DistanceTypeConfig.greedyDistanceSubstring(3))

 // 貪欲距離(完全一致)を使用する場合
 new FuzzySearch(DistanceTypeConfig.greedyDistanceExact())
 
See Also:
  • Method Details

    • editDistance

      public static FuzzySearch.DistanceTypeConfig editDistance()
      編集距離の設定を作成する
      Returns:
      EditDistance用の設定
    • greedyDistanceSubstring

      public static FuzzySearch.DistanceTypeConfig greedyDistanceSubstring(int size)
      貪欲距離(部分一致)の設定を作成する
      Parameters:
      size - マッチングのウィンドウサイズ
      Returns:
      GreedyDistance(Substring)用の設定
    • greedyDistancePrefix

      public static FuzzySearch.DistanceTypeConfig greedyDistancePrefix(int size)
      貪欲距離(前方一致)の設定を作成する
      Parameters:
      size - 前方一致のプレフィックス長
      Returns:
      GreedyDistance(Prefix)用の設定
    • greedyDistanceSuffix

      public static FuzzySearch.DistanceTypeConfig greedyDistanceSuffix(int size)
      貪欲距離(後方一致)の設定を作成する
      Parameters:
      size - 後方一致のサフィックス長
      Returns:
      GreedyDistance(Suffix)用の設定
    • greedyDistanceExact

      public static FuzzySearch.DistanceTypeConfig greedyDistanceExact()
      貪欲距離(完全一致)の設定を作成する

      文字長が一致する場合のみ比較を行います。

      Returns:
      GreedyDistance(Exact)用の設定