Hello,
I already have the code to do the following, but I thought there must be some code existing already that does
it, perhaps more efficiently.
I need to open a text file in a Tk text widget window. The contents of the text file need to be tokenised into words,
punctuation and other symbols removed. This list of tokens/words(list 1) need to be compared with the words
in another text file (list 2, preferably implemented as a hash or hash slice).
For each word in list 1 which is not present in list 2, the
particular word needs to be marked in the Tk text widget in
some way, for example changing the font colour of the word (from black to red, say).
(I have some code that loads a text file in a Tk text widget, saves it, etc.)
Does anyone know of any code that can be used to do the above?
Thanks in advance,
perl_seeker:)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.