title: Scala JSON: Collect and parse an array of arrays with lift
body: <p>I have a JSON that has array of arrays. Like this: </p>
  
  <pre><code>{
    "id": "532242",
    "text": "Some text here. And Here",
    "analysis": {
      "exec": "true",
      "rowID": "always",
      "sentences": {
        "next": null,
        "data": [{
            "sequence": "1",
            "readability_score_lexical": null,
            "readability_score_syntax": null,
            "tokens": [{
                "word": "Some",
                "lemma": "Some"
  
              },
              {
                "word": "text",
                "lemma": "text"
  
              }
            ]
          },
  
  
          {
            "sequence": "3",
            "readability_score_lexical": null,
            "readability_score_syntax": null,
            "tokens": [{
                "word": "and",
                "lemma": "And"
  
              },
              {
                "word": "here",
                "lemma": "here"
  
              }
            ]
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>The structure is pretty complicated, but I cannot do anything on this side because is the response from an API.</p>
  
  <p>What I need is to get a list <code>"tokens"</code> objects. </p>
  
  <p>I did this with lift-web-json:</p>
  
  <pre><code>case class Token(word:String, lemma:String)
  implicit val formats: Formats = net.liftweb.json.DefaultFormats
  val jsonObj = net.liftweb.json.parse(json)
  val tokens = (jsonObj \\ "tokens").children
  for (el &lt;- tokens) {
          val m = el.extract[Token]
          println(s"Word ${m.word} and ${m.lemma}")
      }
  </code></pre>
  
  <p>but it says: </p>
  
  <pre><code>net.liftweb.json.MappingException: No usable value for word
  Do not know how to convert JArray(List(JField(word,JString(Some)), JField(word,JString(text))))
  [...]
  Caused by: net.liftweb.json.MappingException: Do not know how to convert JArray(List(JField(word,JString(Some)), JField(word,JString(text)))) into class java.lang.String
  </code></pre>
  
  <p>And I don't understand how could I make it right.</p>