title: pyparsing keyword, how does it work?
body: <p>I have used <code>pyparsing</code> to parse a big chunk of text and get some numbers.
  The text I am parsing is something like this:</p>
  
  <pre><code>asdkjh                  1      120   203
  kajshd                  230   2309  2309
  Activated Attempts      230   2309  2309
  Activated Attempts      230   2309  2309
  aksjdh                               300
  ...
  </code></pre>
  
  <p>I needed to search for a string and catch all the values which follows right after the given string. The code I have written looks like this and it working fine.</p>
  
  <pre><code>returnValue= 0
  
  integer = pyparsing.Word(pyparsing.nums).setParseAction(lambda toks: int(toks[0]))
  attempted = integer.setResultsName("attempted")
  text = "Activated Attempts"
  
  row = text + attempted
  table = pyparsing.ZeroOrMore(pyparsing.Group(row) | pyparsing.SkipTo(row).suppress())
  
  attempteds = [row.asDict() for row in table.parseString(self.sendLine("lts_pm p"))]
  
  for attempted in attempteds:
      returnValue+= attempted["attempted"]
  
  return returnValue
  </code></pre>
  
  <p>In the case above it would return 460.
  The above function, searches for the given "Activated Attempts" and stores the numbers that is followed by that text, summarizes the numbers and returns.</p>
  
  <p>However I need to add more search queries into the same script, and I tried:</p>
  
  <pre><code>text = pyparsing.Keyword("Activated Attempts") or pyparsing.Keyword("Non Attempts")
  </code></pre>
  
  <p>But the script only catches "Activated Attempts" and returns its number and ignores the second text completely.
  What is the use of <code>Keyword</code> if not this? I have also tried <code>Literal</code> but no success with that either!</p>