Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws Index Error For this Mapping #79

Closed
AdityaSoni19031997 opened this issue Apr 25, 2019 · 3 comments
Closed

Throws Index Error For this Mapping #79

AdityaSoni19031997 opened this issue Apr 25, 2019 · 3 comments

Comments

@AdityaSoni19031997
Copy link

AdityaSoni19031997 commented Apr 25, 2019

Thanks for your lib :) but why is there this error on this mapping? (no empty strings as such)

mis_spell_mapping = {
	'whattsup': 'WhatsApp', 'whatasapp':'WhatsApp', 'whatsupp':'WhatsApp','whatcus':'what cause', 'arewhatsapp': 'are WhatsApp', 'Hwhat':'what',
	'Whwhat': 'What', 'whatshapp':'WhatsApp', 'howhat':'how that','Whybis':'Why is', 'laowhy86':'Foreigners who do not respect China',
	'Whyco-education':'Why co-education',"Howddo":"How do", 'Howeber':'However', 'Showh':'Show',
	"Willowmagic":'Willow magic', 'WillsEye':'Will Eye', 'Williby':'will by'
}
  File "/root/anaconda3/envs/fastaiv3/lib/python3.6/site-packages/flashtext/keyword.py", line 665, in replace_keywords
    current_word += orig_sentence[idy]
IndexError: string index out of range
f_misspell = KeywordProcessor()
for k,v in mis_spell_mapping.items(): 
	f_misspell[k] = v

def spacing_some_connect_words(text): 
    return f_misspell.replace_keywords(text)
df['abc'] = df['abc'].apply(spacing_some_connect_words)
@AdityaSoni19031997
Copy link
Author

AdityaSoni19031997 commented Apr 25, 2019

Never mind, I guess I probably found the fix! (Will update)
Thanks again for the lib :)

@vi3k6i5
Copy link
Owner

vi3k6i5 commented Apr 25, 2019 via email

@AdityaSoni19031997
Copy link
Author

AdityaSoni19031997 commented Apr 25, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants