I have used StringTokenizer class to make tokens of a string but my program tokenizes a string only on the basis of spaces but it does not tokenizes on the basis of special characters such as comma(,),full stop(.),single quotes etc.
Consider a sentence or string:
"I don't know who is he."
After compiling it the output of my program is:
I: valid token
don't: valid token
know: valid token
who: valid token
is: valid token
he!:valid token
but my requirement is:
the short form "don't" should be replaced by "do not" and the out should be:
do: valid token
not: valid token
and
he: valid token
!: valid token
I want your help.Can you suggest me what to do?
I'll be thankful to you
Consider a sentence or string:
"I don't know who is he."
After compiling it the output of my program is:
I: valid token
don't: valid token
know: valid token
who: valid token
is: valid token
he!:valid token
but my requirement is:
the short form "don't" should be replaced by "do not" and the out should be:
do: valid token
not: valid token
and
he: valid token
!: valid token
I want your help.Can you suggest me what to do?
I'll be thankful to you
Comment