32 static const int kMinAbsoluteGarbageWordLength = 10;
33 static const float kMinAbsoluteGarbageAlphanumFrac = 0.5f;
61 for (x = 0; x < word.
length(); ++x) {
64 state = case_state_table[state][1];
66 state = case_state_table[state][2];
68 state = case_state_table[state][3];
70 state = case_state_table[state][0];
71 if (state == -1)
return false;
78 if (word.
length() < kMinAbsoluteGarbageWordLength)
return false;
80 for (
int x = 0; x < word.
length(); ++x) {
84 return (static_cast<float>(num_alphanum) /
85 static_cast<float>(word.
length()) < kMinAbsoluteGarbageAlphanumFrac);
bool get_isupper(UNICHAR_ID unichar_id) const
bool absolute_garbage(const WERD_CHOICE &word, const UNICHARSET &unicharset)
const int case_state_table[6][4]
bool get_isdigit(UNICHAR_ID unichar_id) const
int case_ok(const WERD_CHOICE &word, const UNICHARSET &unicharset)
Check a string to see if it matches a set of lexical rules.
const UNICHAR_ID unichar_id(int index) const
bool get_islower(UNICHAR_ID unichar_id) const
bool get_isalpha(UNICHAR_ID unichar_id) const