-
Notifications
You must be signed in to change notification settings - Fork 5
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
16 changed files
with
2,210 additions
and
3,353 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
import type { KuromojiToken } from "kuromojin"; | ||
/** | ||
* Analyzed result Object | ||
*/ | ||
export type AnalyzedResultObject = { | ||
type: string; | ||
value: string; | ||
surface: string; | ||
token: KuromojiToken; | ||
index: number; | ||
}; | ||
export type AnalyzeOptions = { | ||
/** | ||
* 接続詞を分析対象から除外するかどうか | ||
*/ | ||
ignoreConjunction: boolean; | ||
}; | ||
/** | ||
* Type enum | ||
* @type {{desu: string, dearu: string}} | ||
* @example | ||
* analyze(text).filter(results => results.type === Types.desu); | ||
*/ | ||
export declare const Types: { | ||
desu: string; | ||
masu: string; | ||
dearu: string; | ||
}; | ||
/** | ||
* @param {AnalyzedResultObject} resultObject | ||
* @returns {boolean} | ||
*/ | ||
export declare function isDesumasu({ type }: AnalyzedResultObject): boolean; | ||
/** | ||
* @param {AnalyzedResultObject} resultObject | ||
* @returns {boolean} | ||
*/ | ||
export declare function isDearu({ type }: AnalyzedResultObject): boolean; | ||
/** | ||
* `text`から敬体(ですます調)と常体(である調)を取り出した結果を返します。 | ||
*/ | ||
export declare function analyze(text: string, options?: AnalyzeOptions): Promise<AnalyzedResultObject[]>; | ||
/** | ||
* `text` の敬体(ですます調)について解析し、敬体(ですます調)のトークン情報を返します。 | ||
* @param {string} text | ||
* @param {Object} options | ||
* @return {Promise.<AnalyzedResultObject[]>} | ||
*/ | ||
export declare function analyzeDesumasu(text: string, options?: AnalyzeOptions): Promise<AnalyzedResultObject[]>; | ||
/** | ||
* `text` の常体(である調)について解析し、常体(である調)のトークン情報を返します。 | ||
* @param {string} text | ||
* @param {Object} options | ||
* @return {Promise.<AnalyzedResultObject[]>} | ||
*/ | ||
export declare function analyzeDearu(text: string, options?: AnalyzeOptions): Promise<AnalyzedResultObject[]>; | ||
//# sourceMappingURL=analyze.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
{"root":["../src/analyze.ts"],"version":"5.7.3"} |
Oops, something went wrong.