"Emad Nawfal (عماد نوفل)" <[email protected]> wrote

column is the word, and the second is the composite part of speech tag. For example, Al is a DETERMINER, wlAy is a NOUN and At is a PLURAL NOUN SUFFIX

Al+wlAy+At        DET+NOUN+NSUFF_FEM_PL
Al+mtHd+p        DET+ADJ+NSUFF_FEM_SG

I'd create a dictionary with the parts of speech as keys and the colors(as html strings) as values.

I'd then arrange your data into tuples of (wordpart, speechpart)
So
('Al', DET)('wlAy',NOUN)....

Then you can print with
for item in tuples:
htmlstr += colors[item[1]] + item[0] # might need to add a closing tag too...

Does that help?

Alan G.

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to