-
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.
Add base functions for text conversion
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 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,12 @@ | ||
/** | ||
* Parses a text string into an array matching each character to the readings | ||
* @example "你get唔get到我講咩? (nei5 get1 m4 get1 dou2 ngo5 gong2 me1?)" => [{text: "你", reading: "nei5"}, {text: "get", reading: "get1"}, ...] | ||
* @param {string} text | ||
* @returns {{text: string, reading: string}[]} | ||
*/ | ||
function parseCantoneseReadings(text) { | ||
// TODO | ||
return []; | ||
} | ||
|
||
export { parseCantoneseReadings }; |
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,28 @@ | ||
/** | ||
* Parses a text string into a structured content object. | ||
* @param {string} text | ||
* @returns {import("yomichan-dict-builder/dist/types/yomitan/termbank").StructuredContent} | ||
*/ | ||
function convertTextToSC(text, language) { | ||
if (language !== 'yue') { | ||
return text; | ||
} | ||
// /** | ||
// * @type {import("yomichan-dict-builder/dist/types/yomitan/termbank").StructuredContent} | ||
// */ | ||
// const sc = { | ||
|
||
// }; | ||
// return sc; | ||
return ''; | ||
} | ||
|
||
/** | ||
* Parses a text string into a structured content object. | ||
* @param {string} text | ||
* @returns {import("yomichan-dict-builder/dist/types/yomitan/termbank").StructuredContent} | ||
*/ | ||
function convertCantoneseStringToSC(text) { | ||
// TODO | ||
return ''; | ||
} |