indent and decls
This commit is contained in:
parent
a468406e17
commit
6999284c42
@ -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;
|
||||
|
||||
@ -19,22 +19,18 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#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_ */
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "stoplist.h"
|
||||
#include "smallut.h"
|
||||
#include "utf8iter.h"
|
||||
#include "unacpp.h"
|
||||
|
||||
namespace Rcl {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user