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.

198 HEADER INCLUDE FILES ANNOYANCE-FILTER §243<br />

case 201: /∗ −−version Print version information ∗/<br />

{<br />

〈 Print program version information 245 〉;<br />

}<br />

return 0;<br />

case 218: /∗ −−write fname Write dictionary to fname ∗/<br />

{<br />

ofstream of (optarg , ios ::binary );<br />

if (¬of ) {<br />

cerr ≪ "Cannot␣create␣dictionary␣file␣" ≪ optarg ≪ endl ;<br />

return 1;<br />

}<br />

updateProbability ( );<br />

dict .exportToBinaryFile (of );<br />

of .close ( );<br />

}<br />

break;<br />

default:<br />

cerr ≪ "***Internal␣error:␣unhandled␣case␣" ≪ opt ≪ "␣in␣option␣processing." ≪<br />

endl ;<br />

return 1;<br />

}<br />

}<br />

〈 Check for inconsistencies in option specifications 244 〉;<br />

This code is used in section 223.<br />

244. Some combinations of option specifications make no sense or indicate the user doesn’t understand<br />

how they’re processed. Check for such circumstances and issue warnings to point out the error of the<br />

user’s ways.<br />

〈 Check for inconsistencies in option specifications 244 〉 ≡<br />

if (pTokenTrace ∧ (pDiagFilename ≡ "")) {<br />

cerr ≪ "Warning:␣−−ptrace␣requested␣but␣no␣−−pdiag␣file␣specified." ≪ endl ;<br />

}<br />

if ((transcriptFilename ≠ "") ∧ (nTested ≡ 0)) {<br />

cerr ≪ "Warning:␣−−transcript␣requested␣but␣no␣message␣−−test␣or␣−−\<br />

classify␣done." ≪ endl ;<br />

}<br />

if ((pDiagFilename ≠ "") ∧ (nTested ≡ 0)) {<br />

cerr ≪ "Warning:␣−−pdiag␣requested␣but␣no␣message␣−−test␣or␣−−classify␣done." ≪<br />

endl ;<br />

}<br />

if (annotations .count ( ) > 0 ∧ (transcriptFilename ≡ "")<br />

#ifdef POP3_PROXY_SERVER<br />

∧ (popProxyServer ≡ "")<br />

#endif<br />

) {<br />

cerr ≪ "Warning:␣−−annotate␣requested␣but␣no␣−−transcript␣or␣−−pop3\<br />

proxy␣requested." ≪ endl ;<br />

}<br />

This code is used in section 243.

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

Saved successfully!

Ooh no, something went wrong!