12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

§170 ANNOYANCE-FILTER TOKEN DEFINITION 143<br />

}<br />

return notExclusively [c];<br />

bool isTokenNotAtEnd (const int c) const<br />

{<br />

assert(c ≥ 0 ∧ c < numTokenChars );<br />

return notAtEnd [c];<br />

}<br />

bool isTokenLengthAcceptable (string ::size type l)const<br />

{<br />

return (l ≥ minTokenLength ) ∧ (l ≤ maxTokenLength );<br />

}<br />

bool isTokenLengthAcceptable (const string t) const<br />

{<br />

return isTokenLengthAcceptable (t.length ( ));<br />

}<br />

void setTokenMember (bool v, const int cstart , const int cend = −1)<br />

{<br />

assert(cstart ≥ 0 ∧ cstart ≤ numTokenChars );<br />

assert((cend ≡ −1) ∨ (cend ≥ cstart ∧ cend ≤ numTokenChars ));<br />

for (int i = cstart ; i ≤ cend ; i++) {<br />

isToken [i] = v;<br />

}<br />

}<br />

void setTokenNotExclusively (bool v, const int cstart , const int cend = −1)<br />

{<br />

assert(cstart ≥ 0 ∧ cstart ≤ numTokenChars );<br />

assert((cend ≡ −1) ∨ (cend ≥ cstart ∧ cend ≤ numTokenChars ));<br />

for (int i = cstart ; i ≤ cend ; i++) {<br />

notExclusively [i] = v;<br />

}<br />

}<br />

void setTokenNotAtEnd (bool v, const int cstart , const int cend = −1)<br />

{<br />

assert(cstart ≥ 0 ∧ cstart ≤ numTokenChars );<br />

assert((cend ≡ −1) ∨ (cend ≥ cstart ∧ cend ≤ numTokenChars ));<br />

for (int i = cstart ; i ≤ cend ; i++) {<br />

notAtEnd [i] = v;<br />

}<br />

}<br />

void setISO 8859defaults (unsigned int lmin = 0, unsigned int lmax = 0);<br />

void setUS ASCIIdefaults (unsigned int lmin = 0, unsigned int lmax = 0); } ;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!