@@ -15,68 +15,70 @@ You can get it by signing up at https://detectlanguage.com
1515pip install detectlanguage
1616```
1717
18+ ### Upgrading
19+
20+ When upgrading please check [ changelog] ( CHANGELOG.md ) for breaking changes.
21+
1822### Configuration
1923
2024``` python
2125import detectlanguage
2226
2327detectlanguage.configuration.api_key = " YOUR API KEY"
2428
25- # Enable secure mode (SSL) if you are passing sensitive data
26- # detectlanguage.configuration.secure = True
29+ # You can use proxy if needed
30+ # detectlanguage.configuration.proxies = {'https': 'https://user:pass@proxy:8080'}
2731```
2832
2933## Usage
3034
31- ### Language detection
35+ ### Detect language
3236
3337``` python
34- detectlanguage.detect(" Buenos dias señor " )
38+ detectlanguage.detect(" Dolce far niente " )
3539```
3640
3741#### Result
3842
3943``` python
40- [{' isReliable ' : True , ' confidence ' : 12.04 , ' language ' : ' es ' }]
44+ [{' language ' : ' it ' , ' score ' : 0.5074 }]
4145```
4246
43- ### Simple language detection
47+ ### Detect single code
4448
45- If you need just a language code you can use ` simple_detect ` . It returns just the language code .
49+ If you need just a language code you can use ` detect_code ` .
4650
4751``` python
48- detectlanguage.simple_detect( " Buenos dias señor " )
52+ detectlanguage.detect_code( " Dolce far niente " )
4953```
5054
5155#### Result
5256
5357``` python
54- ' es '
58+ ' it '
5559```
5660
5761### Batch detection
5862
5963It is possible to detect language of several texts with one request.
6064This method is faster than doing one request per text.
61- To use batch detection just pass array of texts to ` detect ` method.
6265
6366``` python
64- detectlanguage.detect ([" Buenos dias señor " , " Labas rytas " ])
67+ detectlanguage.detect_batch ([" Dolce far niente " , " Hello world " ])
6568```
6669
6770#### Result
6871
6972Result is array of detections in the same order as the texts were passed.
7073
7174``` python
72- [ [ {' isReliable' : True , ' confidence' : 12.04 , ' language' : ' es' } ],
73- [ {' isReliable' : True , ' confidence' : 9.38 , ' language' : ' lt' } ] ]
75+ [[{' language' : ' it' , ' score' : 0.5074 }], [{' language' : ' en' , ' score' : 0.9098 }]]
7476```
7577
76- ### Getting your account status
78+ ### Get your account status
7779
7880``` python
79- detectlanguage.user_status ()
81+ detectlanguage.account_status ()
8082```
8183
8284#### Result
@@ -87,25 +89,17 @@ detectlanguage.user_status()
8789 ' plan_expires' : None }
8890```
8991
90- ### Getting list detectable languages
92+ ### Get list of supported languages
9193
9294``` python
9395detectlanguage.languages()
9496```
9597
9698#### Result
9799
98- Array of language codes and names.
99-
100- ## Contribution
101-
102- You are welcome to patch and send GitHub pull requests.
103-
104- ### Testing
105-
106- pip install -r requirements.txt
107- pip install -r test-requirements.txt
108- nosetests
100+ ``` python
101+ [{' code' : ' aa' , ' name' : ' Afar' }, {' code' : ' ab' , ' name' : ' Abkhazian' }, ... ]
102+ ```
109103
110104## License
111105
0 commit comments