editdist.hpp

来自「unix/linux下拼写检查程序源码」· HPP 代码 · 共 26 行

HPP
26
字号
#ifndef __aspeller_edit_distance_hh__#define __aspeller_edit_distance_hh__#include "weights.hpp"namespace aspeller {  // edit_distance finds the shortest edit distance.  The edit distance is   // (cost of swap)(# of swaps) + (cost of deletion)(# of deletions)   //   + (cost of insertion)(# of insertions)   //   + (cost of substitutions)(# of substitutions)  // Preconditions:  // max(strlen(a), strlen(b))*max(of the edit weights) <= 2^15  // a,b are not null pointers  // Returns:  //   the edit distance between a and b  // the running time is tightly asymptotically bounded by strlen(a)*strlen(b)  short edit_distance(const char * a, const char * b,		      const EditDistanceWeights & w = EditDistanceWeights());}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?