@microsoft/recognizers-text-choice
Advanced tools
Comparing version 1.1.4 to 1.2.7
import { Recognizer, IModel, ModelResult } from "@microsoft/recognizers-text"; | ||
export declare enum ChoiceOptions { | ||
None = 0, | ||
None = 0 | ||
} | ||
export declare function recognizeBoolean(query: string, culture: string, options?: ChoiceOptions, fallbackToDefaultCulture?: boolean): Array<ModelResult>; | ||
export declare function recognizeBoolean(query: string, culture: string, options?: ChoiceOptions, fallbackToDefaultCulture?: boolean): ModelResult[]; | ||
export default class ChoiceRecognizer extends Recognizer<ChoiceOptions> { | ||
@@ -7,0 +7,0 @@ constructor(culture: string, options?: ChoiceOptions, lazyInitialization?: boolean); |
@@ -13,5 +13,5 @@ import { IExtractor, ExtractResult } from "@microsoft/recognizers-text"; | ||
constructor(config: IChoiceExtractorConfiguration); | ||
extract(source: string): Array<ExtractResult>; | ||
extract(source: string): ExtractResult[]; | ||
matchValue(source: string[], match: string[], startPos: number): number; | ||
private tokenize(source); | ||
private tokenize; | ||
} | ||
@@ -18,0 +18,0 @@ export interface IBooleanExtractorConfiguration { |
import { IModel, ModelResult, IExtractor, IParser } from "@microsoft/recognizers-text"; | ||
export declare abstract class ChoiceModel implements IModel { | ||
readonly abstract modelTypeName: string; | ||
abstract readonly modelTypeName: string; | ||
protected readonly extractor: IExtractor; | ||
@@ -11,4 +11,4 @@ protected readonly parser: IParser; | ||
export declare class BooleanModel extends ChoiceModel { | ||
readonly modelTypeName: string; | ||
readonly modelTypeName = "boolean"; | ||
protected getResolution(sources: any): any; | ||
} |
@@ -7,15 +7,17 @@ export { default as ChoiceRecognizer, ChoiceOptions, recognizeBoolean } from "./choice/choiceRecognizer"; | ||
export { IChoiceParserConfiguration, ChoiceParser, BooleanParser } from "./choice/parsers"; | ||
export { ChineseBooleanExtractorConfiguration } from "./choice/chinese/boolean"; | ||
export { DutchBooleanExtractorConfiguration } from "./choice/dutch/boolean"; | ||
export { EnglishBooleanExtractorConfiguration } from "./choice/english/boolean"; | ||
export { FrenchBooleanExtractorConfiguration } from "./choice/french/boolean"; | ||
export { GermanBooleanExtractorConfiguration } from "./choice/german/boolean"; | ||
export { JapaneseBooleanExtractorConfiguration } from "./choice/japanese/boolean"; | ||
export { PortugueseBooleanExtractorConfiguration } from "./choice/portuguese/boolean"; | ||
export { JapaneseBooleanExtractorConfiguration } from "./choice/japanese/boolean"; | ||
export { SpanishBooleanExtractorConfiguration } from "./choice/spanish/boolean"; | ||
export { ChineseBooleanExtractorConfiguration } from "./choice/chinese/boolean"; | ||
export { ChineseChoice } from "./resources/chineseChoice"; | ||
export { DutchChoice } from "./resources/dutchChoice"; | ||
export { EnglishChoice } from "./resources/englishChoice"; | ||
export { FrenchChoice } from "./resources/frenchChoice"; | ||
export { GermanChoice } from "./resources/germanChoice"; | ||
export { JapaneseChoice } from "./resources/japaneseChoice"; | ||
export { PortugueseChoice } from "./resources/portugueseChoice"; | ||
export { JapaneseChoice } from "./resources/japaneseChoice"; | ||
export { SpanishChoice } from "./resources/spanishChoice"; | ||
export { ChineseChoice } from "./resources/chineseChoice"; |
export declare namespace ChineseChoice { | ||
const LangMarker = "Chs"; | ||
const TokenizerRegex = "[^\\u3040-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uff66-\\uff9f]"; | ||
const TrueRegex = "(好[的啊呀嘞哇]|没问题|可以|中|好|同意|行|是的|是|对)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "(不行|不好|拒绝|否定|不中|不可以|不是的|不是|不对|不)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
const TrueRegex = "(\u597D[\u7684\u554A\u5440\u561E\u54C7]|\u6CA1\u95EE\u9898|\u53EF\u4EE5|\u4E2D|\u597D|\u540C\u610F|\u884C|\u662F\u7684|\u662F|\u5BF9)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "(\u4E0D\u884C|\u4E0D\u597D|\u62D2\u7EDD|\u5426\u5B9A|\u4E0D\u4E2D|\u4E0D\u53EF\u4EE5|\u4E0D\u662F\u7684|\u4E0D\u662F|\u4E0D\u5BF9|\u4E0D)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
export declare namespace EnglishChoice { | ||
const LangMarker = "Eng"; | ||
const TokenizerRegex = "[^\\w\\d]"; | ||
const TrueRegex = "\\b(true|yes|yep|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
const TrueRegex = "\\b(true|yes|yep|yup|yeah|y|sure|ok|agree)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C|\\u0001f44c)"; | ||
const FalseRegex = "\\b(false|nope|nop|no|not\\s+ok|disagree)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90|\\u0001F44E|\\u0001F590)"; | ||
} |
export declare namespace FrenchChoice { | ||
const LangMarker = "Fr"; | ||
const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; | ||
const TrueRegex = "\\b(s[uû]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|ça march[eé])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const TrueRegex = "\\b(s[u\u00FB]r|ouais|oui|yep|y|sure|approuver|accepter|consentir|d'accord|\u00E7a march[e\u00E9])\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "\\b(faux|nan|non|pas\\s+d'accord|pas\\s+concorder|n'est\\s+pas\\s+(correct|ok)|pas)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
@@ -5,3 +5,3 @@ export declare namespace GermanChoice { | ||
const TrueRegex = "\\b(wahr|ja|jep|j|sicher|ok|einverstanden|mit\\s+Sicherheit|sicherlich|jap|mache ich)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "\\b(falsch|nein|ne|nö|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
const FalseRegex = "\\b(falsch|nein|ne|n\u00F6|nicht\\s+ok|nicht\\s+einverstanden|n)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
export declare namespace JapaneseChoice { | ||
const LangMarker = "Jpn"; | ||
const TokenizerRegex = "[^\\w\\d\\u3040-\\u309f\\u30a0-\\u30ff\\uff00-\\uff9f\\u4e00-\\u9faf\\u3400-\\u4dbf]"; | ||
const TrueRegex = "(はい(!)*|そうです|よい(です)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "(いいえ|ではありません|ではない|じゃない|じゃありません)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
const TrueRegex = "(\u306F\u3044(\uFF01)*|\u305D\u3046\u3067\u3059|\u3088\u3044(\u3067\u3059)*)|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "(\u3044\u3044\u3048|\u3067\u306F\u3042\u308A\u307E\u305B\u3093|\u3067\u306F\u306A\u3044|\u3058\u3083\u306A\u3044|\u3058\u3083\u3042\u308A\u307E\u305B\u3093)|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
@@ -5,3 +5,3 @@ export declare namespace PortugueseChoice { | ||
const TrueRegex = "\\b(verdade|verdadeir[oa]|sim|isso|claro|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "\\b(falso|n[aã]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
const FalseRegex = "\\b(falso|n[a\u00E3]o|incorreto|nada disso)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
export declare namespace SpanishChoice { | ||
const LangMarker = "Spa"; | ||
const TokenizerRegex = "[^\\w\\d\\u00E0-\\u00FC]"; | ||
const TrueRegex = "\\b(verdad|verdadero|sí|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const TrueRegex = "\\b(verdad|verdadero|s\u00ED|sip|s|si|cierto|por supuesto|ok)\\b|(\\uD83D\\uDC4D|\\uD83D\\uDC4C)"; | ||
const FalseRegex = "\\b(falso|no|nop|n|no)\\b|(\\uD83D\\uDC4E|\\u270B|\\uD83D\\uDD90)"; | ||
} |
{ | ||
"name": "@microsoft/recognizers-text-choice", | ||
"version": "1.1.4", | ||
"version": "1.2.7", | ||
"description": "recognizers-text-choice provides recognition of Boolean (yes/no) answers expressed in multiple languages, as well as base classes to support lists of alternative choices.", | ||
@@ -28,3 +28,3 @@ "author": "Microsoft Corp.", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
"node": ">=10.3.0" | ||
}, | ||
@@ -37,5 +37,5 @@ "scripts": { | ||
"dependencies": { | ||
"@microsoft/recognizers-text": "~1.1.4", | ||
"@microsoft/recognizers-text": "~1.2.7", | ||
"grapheme-splitter": "^1.0.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1262946
27
25580
+ Added@microsoft/recognizers-text@1.2.7(transitive)
- Removed@microsoft/recognizers-text@1.1.4(transitive)