Reputation: 605
I have some text that was generate by another system. It combined some words together in what I assume was some sort of wordwrap by-product. So something simple like 'the dog' is combine into 'thedog'.
I checked the ascii and unicode string to see is there wasn't some unseen character in there, but there wasn't. A confounding problem is that this is medical text and a corpus to check against aren't that available. So, real example is '...test to rule out SARS versus pneumonia' ends up as '... versuspneumonia.'
Anyone have a suggestion for finding and separating these?
Upvotes: 7
Views: 1105
Reputation: 605
Here is what I did. I combined a couple of ideas and using a general bootstrapping methodology came up with a pretty good solution. I used Python for all of this.
Upvotes: 0
Reputation: 444
This may be of interest to you http://www.perlmonks.org/?node_id=336331
You can probably use the medical nature of the text to your advantage by using two dictionaries, one containing only medical terminology and one of general English.
If you can isolate out medical words then run the rest of the string against the general dictionary you should get some decent results.
Upvotes: 2
Reputation: 7611
This is a rather tricky problem.
I would probably say a combination method is your best bet.
It'd pretty much be an advanced form of spellcheck. You could automate it more, but I'd not risk it on something that important.
Alternatively, you can look for patterns with when the breaks happen. Thus if, for example, every nth character that should be a space isn't, you can fix that.
Upvotes: 1