Parsing plain text to some structured object
- by Jeriho
I am working on parsing plain text and converting it to key-value pairs.
For example, plain text:
some_uninteresting_thing
key1 valueA, valueB, valueC
key2 valueD
key3 valueE valueF
key4 valueG(valueH, valueI)
key5 some_uninteresting_thing valueJ some_uninteresting_thing
key6 some_uninteresting_thing
(key6 shouldn't be mapped because has no appropriate values) As you can see plain text is lenient. What java library can handle this? If no such library exist, any suggestions on algorithm to do this.