12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

160 CLASSIFY MESSAGE ANNOYANCE-FILTER §190<br />

190. When parser diagnostics are enabled, add lines to the header of the message in the diagnostic<br />

queue to indicate the words we used, their individual probabilities, and the resulting classification of<br />

the message as a whole.<br />

〈 Add classification diagnostics to parser diagnostics queue 190 〉 ≡<br />

ostringstream os ;<br />

list〈string〉::iterator p; /∗ Find the end of the header in the message. If this fails we simply<br />

append the diagnostics to the end of the message. ∗/<br />

for (p = tp.messageQueue .begin ( ); p ≠ tp.messageQueue .end ( ); p++) {<br />

if (p ⃗ length ( ) ≡ 0) {<br />

break;<br />

}<br />

}<br />

os ≪ Xfile ≪ "−Junk−Probability:␣" ≪ setprecision (5) ≪ junkProb;<br />

tp.messageQueue .insert (p, os .str ( ));<br />

os .str ("");<br />

addSignificantWordDiagnostics (messageTranscript , p, rtokens );<br />

This code is used in section 185.

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

Saved successfully!

Ooh no, something went wrong!