The TOLocationEntity annotator identifies locations by looking for a VBD TO NNP part of speech pattern, where the NNP represents the location.
The original version of the code searches all the WordToken annotations in the document for NNP tokens starting at the one that forms part of a VBD, TO, NNP sequence. This means that it matches on the last NNP token it encounters. So the sentence: "James went to South London to ride the London Eye." results in a location of "South London to ride the London Eye", rather than "South London".
This has been fixed to stop looking for NNP tokens as soon as the last contiguous one (to the curent token sequence) has been reached. This results in the correct location string being produced.
The TOLocationEntity annotator identifies locations by looking for a VBD TO NNP part of speech pattern, where the NNP represents the location.
The original version of the code searches all the WordToken annotations in the document for NNP tokens starting at the one that forms part of a VBD, TO, NNP sequence. This means that it matches on the last NNP token it encounters. So the sentence: "James went to South London to ride the London Eye." results in a location of "South London to ride the London Eye", rather than "South London".
This has been fixed to stop looking for NNP tokens as soon as the last contiguous one (to the curent token sequence) has been reached. This results in the correct location string being produced.