Skip to content

Commit

Permalink
Modify README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
LINYE-MARIANA committed Apr 4, 2024
1 parent aba4b59 commit 328c18a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<h1 align="center">
obot_completion_generator
</h1>

<p align="center">
ObotAI入力補完サーバーデータを基づき、渡される入力テキストに対し、補完候補を生成するためのパッケージ
</p>

<div align="center">

[![CI](https://github.com/obot-ai/obot-completion-generator/actions/workflows/CI.yaml/badge.svg)](https://github.com/obot-ai/obot-completion-generator/actions/workflows/CI.yaml)

</div>


## Features

Expand All @@ -12,23 +25,19 @@ import 'package:obot_completion_generator/index.dart';
void main() async {
// Fetcherを利用してサーバーからデータを取得
Fetcher fetcher = Fetcher(
apiKey: "$your_api_key",
getEndpoint: (String locale) {
return "$api_host/input_completion/$locale/";
}
);
apiKey: "$your_api_key",
getEndpoint: (String locale) {
return "$api_host/input_completion/$locale/";
});
List<LocaleDataItem> jaData = await fetcher.fetch("ja");
// Generatorを用いて補完データを生成
Generator generator = Generator(
minKeywordLength: 2,
keywordSeparator: ",",
strictMatchLocales: ["en"]
);
minKeywordLength: 2, keywordSeparator: ",", strictMatchLocales: ["en"]);
generator.loadData("ja", jaData);
List<MatchedResultData> completions = generator.generateCompletions("こんにちは", "ja");
List<MatchedResultData> completions =
generator.generateCompletions("こんにちは", "ja");
print(completions);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: obot_completion_generator
description: A completion generator for ObotAI InputCompletion.
version: 0.0.1
# repository: https://github.com/my_org/my_repo
repository: https://github.com/obot-ai/obot-completion-generator-dart

environment:
sdk: ^3.3.3
Expand Down

0 comments on commit 328c18a

Please sign in to comment.