yomichan/ext/bg/data/options-schema.json
toasted-nutbread f6a38f40dc
Customizable sentence parsing (#1217)
* Add new sentenceParsing options

* Update TextScanner.setOptions

* Assign terminator/quote maps

* Pass sentence parsing info to extractSentence

* Simplify setting

* Add setting for enableTerminationCharacters

* Create new settings for sentence termination characters
2021-01-10 14:43:06 -05:00

955 lines
52 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"version",
"profiles",
"profileCurrent",
"global"
],
"properties": {
"version": {
"type": "integer",
"minimum": 0,
"default": 0
},
"profiles": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"name",
"conditionGroups",
"options"
],
"properties": {
"name": {
"type": "string",
"default": "Default"
},
"conditionGroups": {
"type": "array",
"items": {
"type": "object",
"required": [
"conditions"
],
"properties": {
"conditions": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"operator",
"value"
],
"properties": {
"type": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {}
}
}
}
}
}
},
"options": {
"type": "object",
"required": [
"general",
"audio",
"scanning",
"translation",
"dictionaries",
"parsing",
"anki",
"sentenceParsing"
],
"properties": {
"general": {
"type": "object",
"required": [
"enable",
"enableClipboardPopups",
"resultOutputMode",
"debugInfo",
"maxResults",
"showAdvanced",
"popupDisplayMode",
"popupWidth",
"popupHeight",
"popupHorizontalOffset",
"popupVerticalOffset",
"popupHorizontalOffset2",
"popupVerticalOffset2",
"popupHorizontalTextPosition",
"popupVerticalTextPosition",
"popupScalingFactor",
"popupScaleRelativeToPageZoom",
"popupScaleRelativeToVisualViewport",
"showGuide",
"compactTags",
"glossaryLayoutMode",
"mainDictionary",
"popupTheme",
"popupOuterTheme",
"customPopupCss",
"customPopupOuterCss",
"enableWanakana",
"enableClipboardMonitor",
"showPitchAccentDownstepNotation",
"showPitchAccentPositionNotation",
"showPitchAccentGraph",
"showIframePopupsInRootFrame",
"useSecurePopupFrameUrl",
"usePopupShadowDom",
"usePopupWindow",
"maximumClipboardSearchLength",
"popupCurrentIndicatorMode",
"popupActionBarVisibility",
"popupActionBarLocation"
],
"properties": {
"enable": {
"type": "boolean",
"default": true
},
"enableClipboardPopups": {
"type": "boolean",
"default": false
},
"resultOutputMode": {
"type": "string",
"enum": ["group", "merge", "split"],
"default": "group"
},
"debugInfo": {
"type": "boolean",
"default": false
},
"maxResults": {
"type": "integer",
"minimum": 1,
"default": 32
},
"showAdvanced": {
"type": "boolean",
"default": false
},
"popupDisplayMode": {
"type": "string",
"enum": ["default", "full-width"],
"default": "default"
},
"popupWidth": {
"type": "number",
"minimum": 0,
"default": 400
},
"popupHeight": {
"type": "number",
"minimum": 0,
"default": 250
},
"popupHorizontalOffset": {
"type": "number",
"default": 0
},
"popupVerticalOffset": {
"type": "number",
"default": 10
},
"popupHorizontalOffset2": {
"type": "number",
"default": 10
},
"popupVerticalOffset2": {
"type": "number",
"default": 0
},
"popupHorizontalTextPosition": {
"type": "string",
"enum": ["below", "above"],
"default": "below"
},
"popupVerticalTextPosition": {
"type": "string",
"enum": ["default", "before", "after", "left", "right"],
"default": "before"
},
"popupScalingFactor": {
"type": "number",
"default": 1
},
"popupScaleRelativeToPageZoom": {
"type": "boolean",
"default": false
},
"popupScaleRelativeToVisualViewport": {
"type": "boolean",
"default": true
},
"showGuide": {
"type": "boolean",
"default": true
},
"compactTags": {
"type": "boolean",
"default": false
},
"glossaryLayoutMode": {
"type": "string",
"enum": ["default", "compact"],
"default": "default"
},
"mainDictionary": {
"type": "string"
},
"popupTheme": {
"type": "string",
"enum": ["default", "dark"],
"default": "default"
},
"popupOuterTheme": {
"type": "string",
"enum": ["default", "dark", "auto"],
"default": "default"
},
"customPopupCss": {
"type": "string",
"default": ""
},
"customPopupOuterCss": {
"type": "string",
"default": ""
},
"enableWanakana": {
"type": "boolean",
"default": true
},
"enableClipboardMonitor": {
"type": "boolean",
"default": false
},
"showPitchAccentDownstepNotation": {
"type": "boolean",
"default": true
},
"showPitchAccentPositionNotation": {
"type": "boolean",
"default": true
},
"showPitchAccentGraph": {
"type": "boolean",
"default": false
},
"showIframePopupsInRootFrame": {
"type": "boolean",
"default": false
},
"useSecurePopupFrameUrl": {
"type": "boolean",
"default": true
},
"usePopupShadowDom": {
"type": "boolean",
"default": true
},
"usePopupWindow": {
"type": "boolean",
"default": false
},
"maximumClipboardSearchLength": {
"type": "integer",
"default": 1000,
"minimum": 0
},
"popupCurrentIndicatorMode": {
"type": "string",
"enum": ["none", "asterisk", "triangle", "bar-left", "bar-right", "dot-left", "dot-right"],
"default": "triangle"
},
"popupActionBarVisibility": {
"type": "string",
"enum": ["auto", "always"],
"default": "auto"
},
"popupActionBarLocation": {
"type": "string",
"enum": ["left", "right", "top", "bottom"],
"default": "right"
}
}
},
"audio": {
"type": "object",
"required": [
"enabled",
"sources",
"volume",
"autoPlay",
"customSourceUrl",
"textToSpeechVoice"
],
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"sources": {
"type": "array",
"items": {
"type": "string",
"enum": [
"jpod101",
"jpod101-alternate",
"jisho",
"text-to-speech",
"text-to-speech-reading",
"custom"
],
"default": "jpod101"
},
"default": [
"jpod101"
]
},
"volume": {
"type": "number",
"minimum": 0,
"maximum": 100,
"default": 100
},
"autoPlay": {
"type": "boolean",
"default": false
},
"customSourceUrl": {
"type": "string",
"default": ""
},
"textToSpeechVoice": {
"type": "string",
"default": ""
}
}
},
"scanning": {
"type": "object",
"required": [
"inputs",
"preventMiddleMouse",
"touchInputEnabled",
"pointerEventsEnabled",
"selectText",
"alphanumeric",
"autoHideResults",
"delay",
"hideDelay",
"length",
"deepDomScan",
"popupNestingMaxDepth",
"enablePopupSearch",
"enableOnPopupExpressions",
"enableOnSearchPage",
"enableSearchTags",
"layoutAwareScan"
],
"properties": {
"inputs": {
"type": "array",
"default": [
{
"include": "shift",
"exclude": "mouse0",
"types": {
"mouse": true,
"touch": false,
"pen": false
},
"options": {
"showAdvanced": false,
"searchTerms": true,
"searchKanji": true,
"scanOnTouchMove": true,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false,
"preventTouchScrolling": false
}
},
{
"include": "",
"exclude": "",
"types": {
"mouse": false,
"touch": true,
"pen": true
},
"options": {
"showAdvanced": false,
"searchTerms": true,
"searchKanji": true,
"scanOnTouchMove": true,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false,
"preventTouchScrolling": true
}
}
],
"items": {
"required": [
"include",
"exclude",
"types",
"options"
],
"properties": {
"include": {
"type": "string",
"default": "shift"
},
"exclude": {
"type": "string",
"default": ""
},
"types": {
"type": "object",
"required": [
"mouse",
"touch",
"pen"
],
"properties": {
"mouse": {
"type": "boolean",
"default": true
},
"touch": {
"type": "boolean",
"default": true
},
"pen": {
"type": "boolean",
"default": true
}
}
},
"options": {
"type": "object",
"required": [
"showAdvanced",
"searchTerms",
"searchKanji",
"scanOnTouchMove",
"scanOnPenHover",
"scanOnPenPress",
"scanOnPenRelease",
"preventTouchScrolling"
],
"properties": {
"showAdvanced": {
"type": "boolean",
"default": false
},
"searchTerms": {
"type": "boolean",
"default": true
},
"searchKanji": {
"type": "boolean",
"default": true
},
"scanOnTouchMove": {
"type": "boolean",
"default": true
},
"scanOnPenHover": {
"type": "boolean",
"default": true
},
"scanOnPenPress": {
"type": "boolean",
"default": true
},
"scanOnPenRelease": {
"type": "boolean",
"default": false
},
"preventTouchScrolling": {
"type": "boolean",
"default": true
}
}
}
}
}
},
"preventMiddleMouse": {
"type": "object",
"required": [
"onWebPages",
"onPopupPages",
"onSearchPages",
"onSearchQuery"
],
"properties": {
"onWebPages": {
"type": "boolean",
"default": false
},
"onPopupPages": {
"type": "boolean",
"default": false
},
"onSearchPages": {
"type": "boolean",
"default": false
},
"onSearchQuery": {
"type": "boolean",
"default": false
}
}
},
"touchInputEnabled": {
"type": "boolean",
"default": true
},
"pointerEventsEnabled": {
"type": "boolean",
"default": false
},
"selectText": {
"type": "boolean",
"default": true
},
"alphanumeric": {
"type": "boolean",
"default": true
},
"autoHideResults": {
"type": "boolean",
"default": false
},
"delay": {
"type": "number",
"minimum": 0,
"default": 20
},
"hideDelay": {
"type": "number",
"minimum": 0,
"default": 0
},
"length": {
"type": "integer",
"minimum": 1,
"default": 10
},
"deepDomScan": {
"type": "boolean",
"default": false
},
"popupNestingMaxDepth": {
"type": "integer",
"minimum": 0,
"default": 0
},
"enablePopupSearch": {
"type": "boolean",
"default": false
},
"enableOnPopupExpressions": {
"type": "boolean",
"default": false
},
"enableOnSearchPage": {
"type": "boolean",
"default": true
},
"enableSearchTags": {
"type": "boolean",
"default": false
},
"layoutAwareScan": {
"type": "boolean",
"default": false
}
}
},
"translation": {
"type": "object",
"required": [
"convertHalfWidthCharacters",
"convertNumericCharacters",
"convertAlphabeticCharacters",
"convertHiraganaToKatakana",
"convertKatakanaToHiragana",
"collapseEmphaticSequences",
"textReplacements"
],
"properties": {
"convertHalfWidthCharacters": {
"type": "string",
"enum": ["false", "true", "variant"],
"default": "false"
},
"convertNumericCharacters": {
"type": "string",
"enum": ["false", "true", "variant"],
"default": "false"
},
"convertAlphabeticCharacters": {
"type": "string",
"enum": ["false", "true", "variant"],
"default": "false"
},
"convertHiraganaToKatakana": {
"type": "string",
"enum": ["false", "true", "variant"],
"default": "false"
},
"convertKatakanaToHiragana": {
"type": "string",
"enum": ["false", "true", "variant"],
"default": "variant"
},
"collapseEmphaticSequences": {
"type": "string",
"enum": ["false", "true", "full"],
"default": "false"
},
"textReplacements": {
"type": "object",
"required": [
"searchOriginal",
"groups"
],
"properties": {
"searchOriginal": {
"type": "boolean",
"default": true
},
"groups": {
"type": "array",
"items": {
"type": "array",
"items": {
"required": [
"pattern",
"ignoreCase",
"replacement"
],
"properties": {
"pattern": {
"type": "string",
"default": ""
},
"ignoreCase": {
"type": "boolean",
"default": false
},
"replacement": {
"type": "string",
"default": ""
}
}
}
}
}
}
}
}
},
"dictionaries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"priority",
"enabled",
"allowSecondarySearches"
],
"properties": {
"priority": {
"type": "number",
"default": 0
},
"enabled": {
"type": "boolean",
"default": true
},
"allowSecondarySearches": {
"type": "boolean",
"default": false
}
}
}
},
"parsing": {
"type": "object",
"required": [
"enableScanningParser",
"enableMecabParser",
"selectedParser",
"termSpacing",
"readingMode"
],
"properties": {
"enableScanningParser": {
"type": "boolean",
"default": true
},
"enableMecabParser": {
"type": "boolean",
"default": false
},
"selectedParser": {
"type": ["string", "null"],
"default": null
},
"termSpacing": {
"type": "boolean",
"default": true
},
"readingMode": {
"type": "string",
"enum": ["hiragana", "katakana", "romaji", "none"],
"default": "hiragana"
}
}
},
"anki": {
"type": "object",
"required": [
"enable",
"server",
"tags",
"screenshot",
"terms",
"kanji",
"duplicateScope",
"checkForDuplicates",
"fieldTemplates"
],
"properties": {
"enable": {
"type": "boolean",
"default": false
},
"server": {
"type": "string",
"default": "http://127.0.0.1:8765"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"yomichan"
]
},
"screenshot": {
"type": "object",
"required": [
"format",
"quality"
],
"properties": {
"format": {
"type": "string",
"enum": ["png", "jpeg"],
"default": "png"
},
"quality": {
"type": "integer",
"minimum": 0,
"maximum": 100,
"default": 92
}
}
},
"terms": {
"type": "object",
"required": [
"deck",
"model",
"fields"
],
"properties": {
"deck": {
"type": "string",
"default": ""
},
"model": {
"type": "string",
"default": ""
},
"fields": {
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
}
}
},
"kanji": {
"type": "object",
"required": [
"deck",
"model",
"fields"
],
"properties": {
"deck": {
"type": "string",
"default": ""
},
"model": {
"type": "string",
"default": ""
},
"fields": {
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
}
}
},
"duplicateScope": {
"type": "string",
"default": "collection",
"enum": ["collection", "deck", "deck-root"]
},
"checkForDuplicates": {
"type": "boolean",
"default": true
},
"fieldTemplates": {
"type": ["string", "null"],
"default": null
}
}
},
"sentenceParsing": {
"type": "object",
"required": [
"scanExtent",
"enableTerminationCharacters",
"terminationCharacters"
],
"properties": {
"scanExtent": {
"type": "integer",
"minimum": 0,
"default": 200
},
"enableTerminationCharacters": {
"type": "boolean",
"default": true
},
"terminationCharacters": {
"type": "array",
"items": {
"type": "object",
"required": [
"enabled",
"character1",
"character2",
"includeCharacterAtStart",
"includeCharacterAtEnd"
],
"properties": {
"enabled": {
"type": "boolean",
"default": true
},
"character1": {
"type": "string",
"default": "\"",
"minLength": 1,
"maxLength": 1
},
"character2": {
"type": ["string", "null"],
"default": "\"",
"minLength": 1,
"maxLength": 1
},
"includeCharacterAtStart": {
"type": "boolean",
"default": false
},
"includeCharacterAtEnd": {
"type": "boolean",
"default": false
}
}
},
"default": [
{"enabled": true, "character1": "「", "character2": "」", "includeCharacterAtStart": false, "includeCharacterAtEnd": false},
{"enabled": true, "character1": "『", "character2": "』", "includeCharacterAtStart": false, "includeCharacterAtEnd": false},
{"enabled": true, "character1": "\"", "character2": "\"", "includeCharacterAtStart": false, "includeCharacterAtEnd": false},
{"enabled": true, "character1": "'", "character2": "'", "includeCharacterAtStart": false, "includeCharacterAtEnd": false},
{"enabled": true, "character1": ".", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "!", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "?", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "。", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true},
{"enabled": true, "character1": "…", "character2": null, "includeCharacterAtStart": false, "includeCharacterAtEnd": true}
]
}
}
}
}
}
}
}
},
"profileCurrent": {
"type": "integer",
"minimum": 0,
"default": 0
},
"global": {
"type": "object",
"required": [
"database",
"useSettingsV2"
],
"properties": {
"database": {
"type": "object",
"required": [
"prefixWildcardsSupported"
],
"properties": {
"prefixWildcardsSupported": {
"type": "boolean",
"default": false
}
}
},
"useSettingsV2": {
"type": "boolean",
"default": true
}
}
}
}
}