diff --git a/language_detection/langdetect.py b/language_detection/langdetect.py new file mode 100644 index 000000000..3bfb13ac7 --- /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)) diff --git a/language_detection/readme.md b/language_detection/readme.md new file mode 100644 index 000000000..fb99d7904 --- /dev/null +++ b/language_detection/readme.md @@ -0,0 +1,44 @@ +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 + +## Installation + +To install the required library, you can use the following command: + +```bash +pip install langdetect +``` + +Alternatively, you can install it from the `requirements.txt` file: + +```bash +pip install -r requirements.txt +``` + +## 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 diff --git a/language_detection/requirements.txt b/language_detection/requirements.txt new file mode 100644 index 000000000..084b89b2e --- /dev/null +++ b/language_detection/requirements.txt @@ -0,0 +1 @@ +langdetect==1.0.9