Thursday, 19 September 2013

Creating tokens from xml in java

Creating tokens from xml in java

How tokenization can be achieved in Java for the below input?
The input is an xml file and need tokens as mentioned in the output.
Sample Input:
<Person>Peter Cathery</Person> lives in
<Location>Melbourne</Location>,
<Location>Australia</Location>
. He is 50 years old and he spent
<Money>$100000</Money>
on his house and any kind of disputes on his house will be part of the
jurisdiction of
<Location>Melbourne</Location>
police station. His date of birth:
<Date>11-12-1982</Date> and he works for
<Organization>IBM Corporation Ltd</Organization>.
Output required:
Token 1: Peter Cathery
Token 2: lives
Token 3: in
Token 4: Melbourne
Token 5: ,

No comments:

Post a Comment