Skip to content

Instantly share code, notes, and snippets.

@MahraibFatima
Created February 16, 2024 13:16
Show Gist options
  • Save MahraibFatima/a046a49770bf39ac2f7582bf277f8f94 to your computer and use it in GitHub Desktop.
Save MahraibFatima/a046a49770bf39ac2f7582bf277f8f94 to your computer and use it in GitHub Desktop.
So the user can enter text in whatever language the user likes, program will detect that language but it will give the short form of that language as output.
from langdetect import detect
text = input("Enter any text in any language: ")
print(detect(text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment