Skip to content

Commit a28959d

Browse files
authored
Merge pull request #981 from tusharmishra069/langdetect
Langdetect
2 parents e97cdb6 + dcf125f commit a28959d

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

Diff for: language_detection/langdetect.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from langdetect import detect
2+
3+
text = input("Enter Any text in any language: ")
4+
print(detect(text))

Diff for: language_detection/readme.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Language Detection Tool
2+
# Language Detection Tool
3+
4+
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.
5+
6+
## Features
7+
8+
- Detects the language of any given text input.
9+
- Supports multiple languages.
10+
- Simple and easy to use.
11+
12+
## Prerequisites
13+
14+
Before running the project, you need to have Python installed on your machine. Additionally, you need to install the `langdetect` library.
15+
16+
## Installation
17+
18+
## Installation
19+
20+
To install the required library, you can use the following command:
21+
22+
```bash
23+
pip install langdetect
24+
```
25+
26+
Alternatively, you can install it from the `requirements.txt` file:
27+
28+
```bash
29+
pip install -r requirements.txt
30+
```
31+
32+
## Usage
33+
34+
```python
35+
from langdetect import detect
36+
37+
text = "Your text here"
38+
language = detect(text)
39+
print(f"The detected language is: {language}")
40+
```
41+
42+
## License
43+
44+
This project is licensed under the MIT License.

Diff for: language_detection/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
langdetect==1.0.9

0 commit comments

Comments
 (0)