فهرست منبع

Merge pull request #3697 from richardkchapman/saltlib-stringBOW

GH-524 Add stringMatchBagOfWords to the saltlib plugin

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 12 سال پیش
والد
کامیت
abf0882c64
3فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 2 1
      plugins/proxies/lib_saltlib.eclmod
  2. 1 1
      plugins/stringlib/stringlib.cpp
  3. 3 0
      plugins/stringlib/stringlib.hpp

+ 2 - 1
plugins/proxies/lib_saltlib.eclmod

@@ -15,11 +15,12 @@
     limitations under the License.
 ############################################################################## */
 
-/* Proxy service header for (EE-only) saltlib plugin version SALTLIB 1.0.02 */
+/* Proxy service header for (EE-only) saltlib plugin version SALTLIB 1.0.03 */
 
 export SaltLib := SERVICE
   boolean UnicodeLocaleWithinEditN(const unicode left, const unicode right, unsigned4 distance,  const varstring localename) : c, pure,entrypoint='ulUnicodeLocaleWithinEditN', hole;
   integer4 UnicodeLocaleMatchBagofwords(const unicode left, const unicode right, const varstring localename, unsigned4 mode, unsigned4 score_mode) : c, pure,entrypoint='ulUnicodeLocaleMatchBagofwords', hole;
   unicode UnicodeLocaleGetRangeOfWords(const unicode text, unsigned4 s_index, unsigned4 e_index, const varstring localename) : c,pure,entrypoint='ulUnicodeLocaleGetRangeOfWords';
+  integer4 StringMatchBagofwords(const string left, const string right, unsigned4 mode, unsigned4 score_mode, unsigned fn, unsigned fn_arg1, unsigned fn_arg2) : c, pure,entrypoint='ulStringMatchBagofwords', hole;
 END;
 

+ 1 - 1
plugins/stringlib/stringlib.cpp

@@ -422,7 +422,7 @@ unsigned editDistanceV2(unsigned leftLen, const char * left, unsigned rightLen,
 // * special case edit1 - you could use variables for the 6 interesting array elements, and get
 //   rid of the array completely.  You could also unwind the first (and last iterations).
 // * I suspect the early exit condition could be improved depending the lengths of the strings.
-unsigned editDistanceV3(unsigned leftLen, const char * left, unsigned rightLen, const char * right, unsigned radius)
+extern STRINGLIB_API unsigned editDistanceV3(unsigned leftLen, const char * left, unsigned rightLen, const char * right, unsigned radius)
 {
     if (radius >= 255)
         return 255;

+ 3 - 0
plugins/stringlib/stringlib.hpp

@@ -87,4 +87,7 @@ STRINGLIB_API unsigned STRINGLIB_CALL slMatchDate(size32_t lenS, const char * s,
 STRINGLIB_API void STRINGLIB_CALL slFormatDate(size32_t & __lenResult, char * & __result, unsigned date, const char * format);
 }
 
+namespace nsStringlib {
+extern STRINGLIB_API unsigned editDistanceV3(unsigned leftLen, const char * left, unsigned rightLen, const char * right, unsigned radius);
+}
 #endif