indent and decls
This commit is contained in:
parent
a468406e17
commit
6999284c42
@ -26,8 +26,10 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "utf8iter.h"
|
#include "utf8iter.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
bool unacmaybefold(const string &in, string &out,
|
bool unacmaybefold(const string &in, string &out,
|
||||||
const char *encoding, UnacOp what)
|
const char *encoding, UnacOp what)
|
||||||
{
|
{
|
||||||
char *cout = 0;
|
char *cout = 0;
|
||||||
size_t out_len;
|
size_t out_len;
|
||||||
|
|||||||
@ -19,22 +19,18 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifndef NO_NAMESPACES
|
|
||||||
using std::string;
|
|
||||||
#endif /* NO_NAMESPACES */
|
|
||||||
|
|
||||||
// A small stringified wrapper for unac.c
|
// A small stringified wrapper for unac.c
|
||||||
enum UnacOp {UNACOP_UNAC = 1, UNACOP_FOLD = 2, UNACOP_UNACFOLD = 3};
|
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);
|
const char *encoding, UnacOp what);
|
||||||
|
|
||||||
// Utility function to determine if string begins with capital
|
// 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
|
// 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
|
// Utility function to determine if any character is accented. This
|
||||||
// approprialey ignores the characters from unac_except_chars which
|
// approprialey ignores the characters from unac_except_chars which
|
||||||
// are really separate letters
|
// are really separate letters
|
||||||
extern bool unachasaccents(const string& in);
|
extern bool unachasaccents(const std::string& in);
|
||||||
|
|
||||||
#endif /* _UNACPP_H_INCLUDED_ */
|
#endif /* _UNACPP_H_INCLUDED_ */
|
||||||
|
|||||||
@ -40,9 +40,7 @@ public:
|
|||||||
* @param op defines if we remove diacritics, case or both
|
* @param op defines if we remove diacritics, case or both
|
||||||
*/
|
*/
|
||||||
SynTermTransUnac(UnacOp op)
|
SynTermTransUnac(UnacOp op)
|
||||||
: m_op(op)
|
: m_op(op) { }
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual std::string name() {
|
virtual std::string name() {
|
||||||
std::string nm("Unac: ");
|
std::string nm("Unac: ");
|
||||||
if (m_op & UNACOP_UNAC)
|
if (m_op & UNACOP_UNAC)
|
||||||
@ -51,11 +49,11 @@ public:
|
|||||||
nm += "FOLD ";
|
nm += "FOLD ";
|
||||||
return nm;
|
return nm;
|
||||||
}
|
}
|
||||||
virtual std::string operator()(const std::string& in)
|
virtual std::string operator()(const std::string& in) {
|
||||||
{
|
std::string out;
|
||||||
string out;
|
|
||||||
unacmaybefold(in, out, "UTF-8", m_op);
|
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;
|
return out;
|
||||||
}
|
}
|
||||||
UnacOp m_op;
|
UnacOp m_op;
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include "stoplist.h"
|
#include "stoplist.h"
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "utf8iter.h"
|
#include "utf8iter.h"
|
||||||
|
#include "unacpp.h"
|
||||||
|
|
||||||
namespace Rcl {
|
namespace Rcl {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user