使用java中的标记从文本创建标记

时间:2013-09-19 07:39:47

标签: java xml

如何在Java中为以下输入实现标记化?

输入是一个文本文件,需要按照提到的那样获得输出。

示例输入:

<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>.

需要输出:

Token 1: Peter Cathery
Token 2: lives
Token 3: in
Token 4: Melbourne
Token 5: ,

0 个答案:

没有答案