vi3k6i5 / flashtext

Extract Keywords from sentence or Replace keywords in sentences.
MIT License
5.57k stars 598 forks source link

Get tags that come after a linebreak #136

Open Moxelbert opened 1 year ago

Moxelbert commented 1 year ago

Hi guys,

first of all, thanks a lot for your great library, it is a huge help on my current project. I have one question though: I need to find the indices of certain tags (':F50:') in a string that I get from an XML file. These tags come after a linebreak, which in xml is represented by '&#xD'. However, some of the tags are followed by an '/' whereas others are not. When I add ':F50:' to the list of keywords, the keyword processor is able to find the tags that are being followed by the '/', but not the other ones. Only if I add ':F50' to the keyword list, the ones without a '/' are found. My concern is, that with ':F50' as part of the keyword list, the keyword processor finds more tags than I desire. Is there an explanation for that behavior? If yes, can I somehow work around it? Would it make sense to replace the xml formatted linebreak with a different value?

Thanks a lot in advance for any help provided!