Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>use <code>lxml</code>:</p> <pre><code>mytext="""&lt;contextfile concordance=brown&gt; &lt;context filename=br-a01 paras=yes&gt; &lt;p pnum=1&gt; .... &lt;wf cmd=done pos=VB lemma=say wnsn=1 lexsn=2:32:00::&gt;said&lt;/wf&gt; &lt;wf cmd=done pos=NN lemma=friday wnsn=1 lexsn=1:28:00::&gt;Friday&lt;/wf&gt; &lt;wf cmd=ignore pos=DT&gt;an&lt;/wf&gt; .... .... &lt;punc&gt;``&lt;/punc&gt; &lt;wf cmd=ignore pos=DT&gt;no&lt;/wf&gt; &lt;wf cmd=done pos=NN lemma=evidence wnsn=1 lexsn=1:09:00::&gt;evidence&lt;/wf&gt; &lt;punc&gt;''&lt;/punc&gt; .... &lt;wf cmd=done pos=NN lemma=irregularity wnsn=1 lexsn=1:04:00::&gt;irregularities&lt;/wf&gt; &lt;punc&gt;.&lt;/punc&gt; &lt;/s&gt; &lt;/p&gt; &lt;/context&gt; &lt;/contextfile&gt;""" from lxml import html parsed = html.fromstring(mytext) for x in parsed.getiterator(): print x.tag, x.attrib, x.text, x.tail </code></pre> <p>output:</p> <pre><code>contextfile {'concordance': 'brown'} None None context {'paras': 'yes', 'filename': 'br-a01'} None None p {'pnum': '1'} .... wf {'lemma': 'say', 'cmd': 'done', 'wnsn': '1', 'pos': 'VB', 'lexsn': '2:32:00::'} said None wf {'lemma': 'friday', 'cmd': 'done', 'wnsn': '1', 'pos': 'NN', 'lexsn': '1:28:00::'} Friday None wf {'cmd': 'ignore', 'pos': 'DT'} an .... .... punc {} `` None wf {'cmd': 'ignore', 'pos': 'DT'} no None wf {'lemma': 'evidence', 'cmd': 'done', 'wnsn': '1', 'pos': 'NN', 'lexsn': '1:09:00::'} evidence None punc {} '' .... wf {'lemma': 'irregularity', 'cmd': 'done', 'wnsn': '1', 'pos': 'NN', 'lexsn': '1:04:00::'} irregularities None punc {} . None </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload