Skip to content

Commit c157288

Browse files
committed
Add changelog
1 parent c0ee98c commit c157288

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
9+
## [2.0.0]
10+
11+
### Added
12+
- `detect_batch` method for batch detections
13+
14+
### Changed
15+
- Switched to v3 API which uses updated language detection model
16+
- ⚠️ `simple_detect` method renamed to `detect_code`
17+
- ⚠️ `detect` method result fields are `language` and `score`
18+
- ⚠️ `detect` method no longer accept arrays - use `detect_batch` instead
19+
- ⚠️ `user_status` method renamed to `account_status`
20+
- ⚠️ Proxy URL configured using `config.proxy`
21+
- HTTPS is used by default. Removed secure_mode configuration
22+
- Client connection is reused. If you change configuration after client is initialized, you need to reset client using `DetectLanguage.client = nil`.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Detect Language API Ruby Client
66

77
Detects language of the given text. Returns detected language codes and scores.
88

9+
910
## Installation
1011

1112
Add this line to your application's Gemfile:
@@ -14,6 +15,10 @@ Add this line to your application's Gemfile:
1415
gem 'detect_language'
1516
```
1617

18+
### Upgrading
19+
20+
When upgrading please check [changelog](CHANGELOG.md) for breaking changes.
21+
1722
### Configuration
1823

1924
Get your personal API key by signing up at https://detectlanguage.com
@@ -35,7 +40,7 @@ DetectLanguage.detect("Buenos dias señor")
3540
#### Result
3641

3742
```ruby
38-
[{"language"=>"es", "isReliable"=>true, "confidence"=>6.62}]
43+
[{"language"=>"es", "score"=>0.95}]
3944
```
4045

4146
### Language code detection
@@ -67,8 +72,8 @@ DetectLanguage.detect_batch(["Buenos dias señor", "Labas rytas"])
6772
Result is array of detections in the same order as the texts were passed.
6873

6974
```ruby
70-
[ [{"language"=>"es", "isReliable"=>true, "confidence"=>6.62}],
71-
[{"language"=>"lt", "isReliable"=>true, "confidence"=>6.82}] ]
75+
[ [{"language"=>"es", "score"=>0.95}],
76+
[{"language"=>"lt", "score"=>0.98}] ]
7277
```
7378

7479
### Getting your account status

0 commit comments

Comments
 (0)