diff --git a/lite/dicttok.cpp b/lite/dicttok.cpp index b736a6a..a20c229 100644 --- a/lite/dicttok.cpp +++ b/lite/dicttok.cpp @@ -772,26 +772,18 @@ switch (typ) // Put this as a variable on the node! int ansi = (unsigned char) *str; replaceNum(node,_T("CTRL"),ansi); - makeTextAttrs(node,last); + findTokAttrs(node,last,con,str,lcstr); } break; case PNALPHA: case PNEMOJI: - makeTextAttrs(node,last); - con = NULL; - if (str && *str) { - con = cg_->findWordConcept(str); - } - if (!con && lcstr && *lcstr) { - con = cg_->findWordConcept(lcstr); - } - findAttrs(node, con, str, false); + findTokAttrs(node,last,con,str,lcstr); break; case PNNUM: // Placed here for easy reference. ++totnums_; // Fall through to PNPUNCT for now. case PNPUNCT: - makeTextAttrs(node,last); + findTokAttrs(node,last,con,str,lcstr); break; case PNWHITE: prevwh_ = true; @@ -808,6 +800,18 @@ else if (root_) // Sanity check. return node; } +void DICTTok::findTokAttrs(Node *node, Node *last, CONCEPT *con, _TCHAR *str, _TCHAR *lcstr) { + makeTextAttrs(node,last); + con = NULL; + if (str && *str) { + con = cg_->findWordConcept(str); + } + if (!con && lcstr && *lcstr) { + con = cg_->findWordConcept(lcstr); + } + findAttrs(node, con, str, false); +} + void DICTTok::makeTextAttrs(Node *node, Node *last) { if (prevwh_) replaceNum(node,_T("SP"),1); @@ -821,7 +825,6 @@ void DICTTok::makeTextAttrs(Node *node, Node *last) { lines_ = tabs_ = 0; } - inline bool DICTTok::findAttrs(Node *node, CONCEPT *con, _TCHAR *str, bool isSuggested) { _TCHAR attrName[NAMESIZ]; _TCHAR bufval[NAMESIZ]; diff --git a/lite/dicttok.h b/lite/dicttok.h index c73ff05..b31a650 100644 --- a/lite/dicttok.h +++ b/lite/dicttok.h @@ -96,6 +96,7 @@ class DICTTok : public Algo Htab *htab ); + void findTokAttrs(Node *node, Node *last, CONCEPT *con, _TCHAR *str, _TCHAR *lcstr); void makeTextAttrs(Node *node, Node *last); inline bool findAttrs( diff --git a/nlp/main.cpp b/nlp/main.cpp index c5d5a2d..a1d571f 100644 --- a/nlp/main.cpp +++ b/nlp/main.cpp @@ -15,7 +15,7 @@ All rights reserved. #include "lite/nlp_engine.h" #include "version.h" -#define NLP_ENGINE_VERSION "2.12.0" +#define NLP_ENGINE_VERSION "2.12.1" bool cmdReadArgs(int,_TCHAR*argv[],_TCHAR*&,_TCHAR*&,_TCHAR*&,_TCHAR*&,bool&,bool&,bool&); void cmdHelpargs(_TCHAR*);