java - normalizing String with adding appropriate spacing -
probably broad question stackoverflow here goes,
i'm trying normalize words within sentence, example:
input:
- i developgeographicallydispersed teams through asdweq.
output (notice spaces between develop geographically dispersed)
- i develop geographically dispersed teams through asdweq.
since using external api out of option ( e.g. using google api). require design our in house java api
the obvious , naive solution this:
for word in sentence do: if word in dictionary ignore else: if word reduce-able set of dictionary keywords split else ignore od;
so before start such approach, question if there better way of doing it? example open source library, or different approach?
did have @ flex , bison ? helps create scanner , define patterns text processing, should find trick map parser existing dictionary in case.
Comments
Post a Comment