Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import xml.etree.ElementTree as et
  2.  
  3. xtree = et.parse("GLAWI_FR_work_D2015-12-26_R2016-05-18.xml")
  4. xroot = xtree.getroot()
  5.  
  6. for node in xroot:
  7.     title = node.find("title")
  8.     print("Mot scanné :")
  9.     print(title.text)
  10.     text = node.find("text")
  11.     pos = text.find("pos")
  12.     if pos is not None:
  13.         attrib = pos.attrib.get("type")
  14.         if attrib == "verbe":
  15.             print("WESH JE CROIS QUE C'EST UN VERBE : "+title.text)
  16. print("pingouin")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement