Change language detection to include hashtags as words (#11341)
This commit is contained in:
parent
3a6fe657ba
commit
5bfe1e1f05
2 changed files with 4 additions and 4 deletions
|
@ -32,11 +32,11 @@ describe LanguageDetector do
|
|||
expect(result).to eq 'Our website is and also'
|
||||
end
|
||||
|
||||
it 'strips #hashtags from strings before detection' do
|
||||
string = 'Hey look at all the #animals and #fish'
|
||||
it 'converts #hashtags back to normal text before detection' do
|
||||
string = 'Hey look at all the #animals and #FishAndChips'
|
||||
|
||||
result = described_class.instance.send(:prepare_text, string)
|
||||
expect(result).to eq 'Hey look at all the and'
|
||||
expect(result).to eq 'Hey look at all the animals and fish and chips'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue