-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
93 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Changelog | ||
|
||
## [1.1.0](https://github.com/leovan/duckling-chinese/compare/v1.0.0...v1.1.0) (2023-10-19) | ||
|
||
Duckling Core 版本:[1.5.3](https://mvnrepository.com/artifact/com.xiaomi.duckling/duckling-core_2.13/1.5.3) | ||
|
||
### 功能 | ||
|
||
- 添加 `remove_duplicate` 参数用于删除重复结果 | ||
|
||
### 修复 | ||
|
||
- 修复 JDK 9+ 环境下序列化 JSON 结果时 `java.*` API 中非公有成员的反射问题 | ||
|
||
## 1.0.0 (2023-10-15) | ||
|
||
Duckling Core 版本:[1.5.2](https://mvnrepository.com/artifact/com.xiaomi.duckling/duckling-core_2.13/1.5.2) | ||
|
||
### 功能 | ||
|
||
- 第一个发布版本 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
|
||
from duckling_chinese import Duckling | ||
from duckling_chinese.dimension import DucklingDimension | ||
|
||
|
||
class AnalyzeTestCase(unittest.TestCase): | ||
def setUp(self): | ||
self._duckling = Duckling() | ||
self._default_context = self._duckling.gen_context() | ||
|
||
def test_analyze(self): | ||
options = self._duckling.gen_options( | ||
targets={ | ||
DucklingDimension.LYRIC | ||
} | ||
) | ||
|
||
text = '编曲:墨辞 词: 刀郎 曲 周杰伦' | ||
answers = self._duckling.analyze( | ||
text, self._default_context, options) | ||
entities = self._duckling.parse_entities( | ||
text, self._default_context, options) | ||
|
||
self.assertEqual(2, len(answers)) | ||
self.assertEqual(1, len(entities)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |