diff --git a/src/common/unacpp.cpp b/src/common/unacpp.cpp index f161e561..4b7c1714 100644 --- a/src/common/unacpp.cpp +++ b/src/common/unacpp.cpp @@ -26,8 +26,10 @@ #include "log.h" #include "utf8iter.h" -bool unacmaybefold(const string &in, string &out, - const char *encoding, UnacOp what) +using namespace std; + +bool unacmaybefold(const string &in, string &out, + const char *encoding, UnacOp what) { char *cout = 0; size_t out_len; diff --git a/src/common/unacpp.h b/src/common/unacpp.h index e00becdc..1152c85d 100644 --- a/src/common/unacpp.h +++ b/src/common/unacpp.h @@ -19,22 +19,18 @@ #include -#ifndef NO_NAMESPACES -using std::string; -#endif /* NO_NAMESPACES */ - // A small stringified wrapper for unac.c enum UnacOp {UNACOP_UNAC = 1, UNACOP_FOLD = 2, UNACOP_UNACFOLD = 3}; -extern bool unacmaybefold(const string& in, string& out, +extern bool unacmaybefold(const std::string& in, std::string& out, const char *encoding, UnacOp what); // Utility function to determine if string begins with capital -extern bool unaciscapital(const string& in); +extern bool unaciscapital(const std::string& in); // Utility function to determine if string has upper-case anywhere -extern bool unachasuppercase(const string& in); +extern bool unachasuppercase(const std::string& in); // Utility function to determine if any character is accented. This // approprialey ignores the characters from unac_except_chars which // are really separate letters -extern bool unachasaccents(const string& in); +extern bool unachasaccents(const std::string& in); #endif /* _UNACPP_H_INCLUDED_ */ diff --git a/src/rcldb/expansiondbs.h b/src/rcldb/expansiondbs.h index 081ed5a8..0af2190c 100644 --- a/src/rcldb/expansiondbs.h +++ b/src/rcldb/expansiondbs.h @@ -40,9 +40,7 @@ public: * @param op defines if we remove diacritics, case or both */ SynTermTransUnac(UnacOp op) - : m_op(op) - { - } + : m_op(op) { } virtual std::string name() { std::string nm("Unac: "); if (m_op & UNACOP_UNAC) @@ -51,11 +49,11 @@ public: nm += "FOLD "; return nm; } - virtual std::string operator()(const std::string& in) - { - string out; + virtual std::string operator()(const std::string& in) { + std::string out; unacmaybefold(in, out, "UTF-8", m_op); - LOGDEB2("SynTermTransUnac(" << (int(m_op)) << "): in [" << (in) << "] out [" << (out) << "]\n" ); + LOGDEB2("SynTermTransUnac(" << m_op << "): in [" << in << "] out [" << + out << "]\n"); return out; } UnacOp m_op; diff --git a/src/rcldb/termproc.h b/src/rcldb/termproc.h index 9438f594..9406de64 100644 --- a/src/rcldb/termproc.h +++ b/src/rcldb/termproc.h @@ -24,6 +24,7 @@ #include "stoplist.h" #include "smallut.h" #include "utf8iter.h" +#include "unacpp.h" namespace Rcl {