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.

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

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

return 1;<br />

}<br />

updateProbability ( );<br />

dict .exportCSV (of );<br />

of .close ( );<br />

}<br />

break;<br />

case 228: /∗ −−fread fname Load fast dictionary from fname ∗/<br />

if (¬fDict .load (optarg )) {<br />

cerr ≪ "Unable␣to␣load␣fast␣dictionary␣file." ≪ endl ;<br />

return 1;<br />

}<br />

break;<br />

case 229: /∗ −−fwrite fname Export dictionary to fast dictionary fname ∗/<br />

if (dict .size ( ) ≡ 0) {<br />

cerr ≪ "No␣dictionary␣loaded␣when␣−−fwrite␣command␣issued." ≪ endl ;<br />

return 1;<br />

}<br />

fastDictionary ::exportDictionary (dict , optarg );<br />

break;<br />

case ’u’: /∗ −u, −−help Print how-to-call information ∗/<br />

case ’?’: /∗ −? Indication of error parsing command line ∗/<br />

usage ( );<br />

return 0;<br />

#ifdef Jig<br />

case 206: /∗ −−jig Test component in temporary jig ∗/<br />

{<br />

〈 Test component in temporary jig 252 〉;<br />

}<br />

break;<br />

#endif<br />

case ’j’: /∗ −j, −−junk folder Add folder contents to junk mail dictionary ∗/<br />

addFolder (optarg , dictionaryWord ::Junk );<br />

updateProbability ( );<br />

break;<br />

case 202: /∗ −−list Print dictionary on standard output ∗/<br />

printDictionary ( );<br />

break;<br />

case ’m’: /∗ −m, −−mail folder Add folder contents to legitimate mail dictionary ∗/<br />

addFolder (optarg , dictionaryWord ::Mail );<br />

updateProbability ( );<br />

break;<br />

case 220: /∗ −−newword n Set probability for words not in dictionary to n ∗/<br />

novelWordProbability = atof (optarg );<br />

if (verbose ) {<br />

cerr ≪ "Probability␣for␣words␣not␣in␣dictionary␣set␣to␣" ≪ novelWordProbability ≪<br />

"." ≪ endl ;<br />

}<br />

break;

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

Saved successfully!

Ooh no, something went wrong!