From 0efebae2b125beac254213c2ae6d1f3e41dcfedf Mon Sep 17 00:00:00 2001 From: tusharmishra069 Date: Fri, 11 Oct 2024 13:02:45 +0530 Subject: [PATCH] Added the Language detection automation --- language detection/langdetect.py | 4 ++++ language detection/readme.md | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 language detection/langdetect.py create mode 100644 language detection/readme.md diff --git a/language detection/langdetect.py b/language detection/langdetect.py new file mode 100644 index 000000000..514929604 --- /dev/null +++ b/language detection/langdetect.py @@ -0,0 +1,4 @@ +from langdetect import detect + +text = input("Enter Any text in any language:- ") +print(detect(text)) \ No newline at end of file diff --git a/language detection/readme.md b/language detection/readme.md new file mode 100644 index 000000000..f3cd25365 --- /dev/null +++ b/language detection/readme.md @@ -0,0 +1,34 @@ +Language Detection Tool +# Language Detection Tool + +This is a simple Python tool that detects the language of the input text using the `langdetect` library. You can enter any text in any language, and the program will automatically detect and display the language code. + +## Features + +- Detects the language of any given text input. +- Supports multiple languages. +- Simple and easy to use. + +## Prerequisites + +Before running the project, you need to have Python installed on your machine. Additionally, you need to install the `langdetect` library. + +## Installation + +```bash +pip install langdetect +``` + +## Usage + +```python +from langdetect import detect + +text = "Your text here" +language = detect(text) +print(f"The detected language is: {language}") +``` + +## License + +This project is licensed under the MIT License. \ No newline at end of file