This will require writing parsers for the (two different!) plain-text formats that are used for entries returned by the glossing dictionary vs. everything else. For Japanese-to-English, we could probably get away with just using the glossing results, but if we want to allow Japanese-to-Anything-Else, we'll have to recursively look stuff up in the single-word dictionaries as well, because glossing only works for English.
This will require writing parsers for the (two different!) plain-text formats that are used for entries returned by the glossing dictionary vs. everything else. For Japanese-to-English, we could probably get away with just using the glossing results, but if we want to allow Japanese-to-Anything-Else, we'll have to recursively look stuff up in the single-word dictionaries as well, because glossing only works for English.
There's an intro to Scala parser-combinators at https://kerflyn.wordpress.com/2012/08/25/playing-with-scala-parser-combinator/ which might be useful.