MTL Toolbox: Difference between revisions

m (→‎Technical notes: Standard Query Syntax)
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''MTL Toolbox''' (https://learntaiwanese.org/MTLtoolbox/about.html): Modern Taiwanese Language Toolbox. Software and data to help people use written Taiwanese in [[Modern Literal Taiwanese]] (MLT) and other Latin-script writing systems.
'''MTL Toolbox''' (https://learntaiwanese.org/MTLtoolbox/about.html) is software and data to help people use [[written Taiwanese]] in [[Modern Literal Taiwanese]] (MLT) and other [[Latin script|Latin-script]] writing systems.


== Features ==
== Features ==
* six Taiwanese dictionaries spanning from [[Taioaan Jidpurn-sitai|Japanese era]] to present day
* seven Taiwanese dictionaries spanning from [[Taioaan Jidpurn-sitai|Japanese era]] to present day
* full-text search engine accepts written Taiwanese as well as English, and ''[[Harnji]]''
* full-text search engine accepts written Taiwanese as well as English, and ''[[Harnji]]''
* audio from government-compiled dictionary: [[DFT]]
* audio from government-compiled dictionary: [[Dictionary of Frequently-Used Taiwanese Taigi]] (DFT)
* basic [[text segmentation]] (including "unjoining" into syllables) and "bag-of-syllables" search
* basic [[text segmentation]] (including "unjoining" into syllables, or [[syllabification]]) and "bag-of-syllables" search
* ''Seven Tones'' soundboard: [[table of all MLT finals]] with examples
* {{Seven-Tones-Soundboard-link}}: [[table of all MLT finals]] with examples


== How to search ==
== How to perform a full-text search ==
We describe how to use "Taiwanese–English dictionaries: MLT segmenter & full-text search". This interface is mainly for Taiwanese words written in MLT, which we refer to as "M-style" written Taiwanese. After entering M-input, press "Zhøe" to run the segmenter and search.
Steps to do a {{w|full-text search}} on our set of Taiwanese dictionaries:
 
* Visit "[[Taiwanese–English dictionaries]] full-text search" {{te|}}:
* Select or deselect which dictionaries to search using the checkboxes. By default, all seven dictionaries are included, as well as "DFT_lk", which is the database table for DFT examples.
* Input search terms to define your search. Typical inputs include English terms, MLT-style syllables (citation tone, before tone sandhi), and number of syllables. Feel free to try any other terms that would help narrow down your search. For example:
** You searched for <code>{{te|apples}}</code>, but didn't get many results. Instead, search for <code>{{te|apple*}}</code>, to get results with any strings that start with "apple".
** If you want only results starting with MLT consonant "[[ph]]", include <code>ph*</code>: <code>{{te|apple*  ph*}}</code>
* In some cases, it is better to specify a column for a term, especially if it could match in multiple columns. To specify the column to search against, follow the column-name by a ":" character, then the term. For example:
** Suppose your search term is "too", which is a valid English word but is also a valid MLT syllable. If you meant the English word, type <code>en:too</code>. If you meant the MLT syllable, type <code>u:too</code> ("u" stands for "unjoined").
** Suppose you want results that contain the very common MLT syllable "lie", which is also a valid word in English. Again, specify the "u" column: <code>u:lie</code>. However, the number of results is still large. If you want only four-syllable results, add <code>ns:4</code>. The entire search input is then <code>{{te|u:lie ns:4}}</code>
** See [[#Technical notes]] for more details.
 
== How to use the MLT segmenter ==
We describe how to use "Taiwanese–English dictionaries: MLT segmenter & full-text search" {{x|}}. You might want to use this tool if you want to search the dictionaries using MLT but don't want to figure out the citation-tone syllables yourself. As most Taiwanese words written in MLT will not have a [[hyphen]] or other character to delimit syllable boundaries, computing the citation tone syllables is a non-trivial process. The MLT segmenter lowers the barrier between MLT and the dictionaries, which have not been completely converted to MLT.
 
To get started, enter your MLT word, then press "Go". The segmenter will process your input. If successful, it will also run a search. Results from HTB and DFT are displayed, and results from other dictionaries are summarized and linked to.  


=== Typical usage ===
=== Typical usage ===
* Input: Taiwanese word (typically disyllable: two syllables joined by [[tone sandhi]])
* Input: Taiwanese word (typically disyllable: two syllables joined by [[tone sandhi]])
** Example: køefcie (copy and paste into this link {{x|}}. you may substitute 0 for [[ø]]: {{x|k0efcie}})
** Example: køefcie (if [[ø]] is not convenient, use 0 (zero) instead: {{x|k0efcie}})
* Press return or tap "Zhøe" (means "search")
* Press return or tap "Go"
** your input is "unjoined" (original syllables found by database lookup)
** your input is "unjoined" (original syllables found by database lookup)
*** in this example, the original syllables are: {{x|køea}} and {{x|cie}}
*** in this example, the original syllables are: {{x|køea}} and {{x|cie}}
** search is done using original syllables (unordered collection of syllables, or "bag-of-syllables" (BOS))
** search is performed using the unordered collection of syllables (we refer to this as "bag-of-syllables" (BOS). see {{w|bag-of-words model}})
** confirm the results are the same as for input:  (except for HTB which is not unjoined)
** confirm that the results are basically the same (except for HTB which is not unjoined) as if you had run a full-text search for either: {{te|køea cie}}, or: {{te|cie køea}}


* Try more examples:
* Try more examples:
Line 26: Line 41:


=== Monosyllable ===
=== Monosyllable ===
* for a [[monosyllable]], exact matches are displayed by default, for example ([[Practical Taiwanese Conversation|PTC]]):
* for a [[monosyllable]], exact matches are displayed by default. Here are some examples from [[Practical Taiwanese Conversation]]:
** {{x|goar}}
** {{x|goar}}
** {{x|lie}}
** {{x|lie}}
** {{x|ee}}
** {{x|ee}}


* if the syllable is a DFT monosyllable, a navigation bar displays adjacent DFT monosyllables in alphabetical order
* if the syllable is a [[Dictionary of Frequently-Used Taiwan Minnan/Monosyllables|DFT monosyllable]], a navigation bar displays adjacent DFT monosyllables in alphabetical order
* due to high number of matches, "monosyllable mode" returns monosyllable search results. To see all matching results, click "Khahzøe"
* due to high number of matches, "monosyllable mode" displays monosyllable search results. To see all matching results, click on <nowiki>[[🔍 ]]</nowiki>


=== Other fields ===
=== Other columns ===
* The "en" button is used to direct the search to the English field (en). Harnji (hj) can also be input, although we do not attempt Chinese text segmentation.
* The "en:" button will prepend "en:" to your search, causing the following token to be matched against the English column.
* We haven't implemented Chinese text segmentation, which is non-trivial (see {{w|Chinese word-segmented writing}}).
* DFT now supports using individual Harnji as tokens. For example, {{x|對 頭}}. The h_j column is the Harnji (hj) column with spaces between characters.


== Data ==
== Data ==
Line 41: Line 58:
* HTB: ''[[Hiexntai-buun Dictionary]]''
* HTB: ''[[Hiexntai-buun Dictionary]]''
* DFT: ''[[Dictionary of Frequently-Used Taiwanese Taigi]]'' (in [[TL]]. We added MLT annotations and annotated over 5800 definitions in English for monosyllables)
* DFT: ''[[Dictionary of Frequently-Used Taiwanese Taigi]]'' (in [[TL]]. We added MLT annotations and annotated over 5800 definitions in English for monosyllables)
* MK: ''[[Maryknoll Taiwanese-English Dictionary]]'' (in [[POJ]]. We added MLT annotations)
* MK: ''[[Maryknoll Taiwanese–English Dictionary]]'' (in [[POJ]]. We added MLT annotations)
* EDUTECH: [[Liim Keahioong]] (2001-2003) ''EDUTECH: Taiwanese-English Dictionary Searched with Concise Atonal Spelling'' (in [[MLT]] with [[Talk:Øe|unified spellings]] (øe))
* EDUTECH: [[Liim Keahioong]] (2001-2003) ''EDUTECH: Taiwanese-English Dictionary Searched with Concise Atonal Spelling'' (in [[MLT]] with [[Talk:Øe|unified spellings]] (øe))
* [[Bernard L.M. Embree|Embree, Bernard L. M.]] (1973). ''[[A Dictionary of Southern Min]]: based on current usage in Taiwan and checked against the earlier works of Carstairs Douglas, Thomas Barclay, and Ernest Tipson''. Hong Kong: Hong Kong Language Institute. (in POJ. We added MLT annotations)
* [[Bernard L.M. Embree|Embree, Bernard L. M.]] (1973). ''[[A Dictionary of Southern Min]]: based on current usage in Taiwan and checked against the earlier works of Carstairs Douglas, Thomas Barclay, and Ernest Tipson''. Hong Kong: Hong Kong Language Institute. (in POJ. We added MLT annotations)
* TDJ: ''[[Tai-Nichi Daijiten]]'' (original 1931 & 1932, in [[Taioaan-guo kana|Taiwanese kana]]. Lim08 version: definitions translated into Taiwanese (Han-Romanization mixed script - POJ). We added MLT annotations)
* TDJ: ''[[Tai-Nichi Daijiten]]'' (original 1931 & 1932, in [[Taioaan-guo kana|Taiwanese kana]]. Lim08 version: definitions translated into Taiwanese (Han-Romanization mixed script - POJ). We added MLT annotations)


The M-fields we present in DFT and MK may be machine-generated ("auto-joined") and may not represent the common or recommended spelling.
Note: The M-fields of DFT and MK are largely machine-generated ("auto-joined") and do not attempt to indicate prescriptive spellings. In some cases, the common or recommended spelling may be different from what is shown. Often, the difference is about [[apostrophe]]s and/or [[hyphen]]s.


We also support searching other websites with conversion to POJ/TL:
We also support searching other websites with conversion to POJ/TL:
Line 53: Line 70:


== Technical notes ==
== Technical notes ==
* [[SQLite]]: [https://sqlite.org/fts3.html FTS4] for full-text search (Standard Query Syntax)
Our full-text search is provided by the [[SQLite]] [https://sqlite.org/fts3.html FTS4] extension. We currently use the Standard Query Syntax. One of the three basic query types supported by FTS tables is "token or token prefix queries":
* Token prefix queries: use the asterisk ('*') at the end. Similar to {{w|wildcard character}} in [[zokgiap hexthorng|operating systems]] (normal wildcard search not currently supported by FTS)
* Specify a token prefix by appending an asterisk ('*') to the prefix. (While similar to {{w|wildcard character}} in [[zokgiap hexthorng|operating systems]], wildcard search is not currently supported by FTS)
** Example: {{x|Taioa*}}, {{x|臺*}}
** Example: {{te|Taioa*}}, {{te|臺*}}
* Specify a column-name followed by a colon (':')
* Specify a column-name followed by a colon (':')
** Example: {{x|hj:頭*}} (returns entries where Taiwanese written with Harnji begins with character for [[thaau]])
** Example: {{te|hj:頭*}} (returns entries where Taiwanese written with Harnji begins with character for [[thaau]])
* Add carat ^ before token to require token to be very first token in its column
* Prefix the token with carat ('^') to require token to be very first token in its column
** Example: {{x|^thaau}}
** Example: {{te|^thaau}}
* [[Ø]] is not folded to lower case by the tokenizer
 
Tokenizer: the default tokenizer ("simple") is used. Because it only does case folding of [[ASCII]] characters, [[Ø]] and ø do not match each other. Some words starting with Ø include {{te|Ørciw}}, {{te|Ørmngg}}, and {{te|Ørtøexli}}.


== See also ==
== See also ==
* [[Taiwanese-English dictionaries]]
* [[Taiwanese–English dictionaries]]


== Acknowledgements ==
== Acknowledgements ==
* The MTL Toolbox uses data from the ''[[Maryknoll Taiwanese-English Dictionary]]'', which was generously released to the public under a [https://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License].
* The MTL Toolbox uses data from the ''[[Maryknoll Taiwanese–English Dictionary]]'', which was generously released to the public under a [https://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License].


[[Category:Peqoexji]]
[[Category:Peqoexji]]
[[Category:Modern Literal Taiwanese]]
[[Category:Modern Literal Taiwanese]]

Latest revision as of 10:01, 20 February 2026

MTL Toolbox (https://learntaiwanese.org/MTLtoolbox/about.html) is software and data to help people use written Taiwanese in Modern Literal Taiwanese (MLT) and other Latin-script writing systems.

Features

How to perform a full-text search

Steps to do a full-text search on our set of Taiwanese dictionaries:

  • Visit "Taiwanese–English dictionaries full-text search" [1]:
  • Select or deselect which dictionaries to search using the checkboxes. By default, all seven dictionaries are included, as well as "DFT_lk", which is the database table for DFT examples.
  • Input search terms to define your search. Typical inputs include English terms, MLT-style syllables (citation tone, before tone sandhi), and number of syllables. Feel free to try any other terms that would help narrow down your search. For example:
    • You searched for apples, but didn't get many results. Instead, search for apple*, to get results with any strings that start with "apple".
    • If you want only results starting with MLT consonant "ph", include ph*: apple* ph*
  • In some cases, it is better to specify a column for a term, especially if it could match in multiple columns. To specify the column to search against, follow the column-name by a ":" character, then the term. For example:
    • Suppose your search term is "too", which is a valid English word but is also a valid MLT syllable. If you meant the English word, type en:too. If you meant the MLT syllable, type u:too ("u" stands for "unjoined").
    • Suppose you want results that contain the very common MLT syllable "lie", which is also a valid word in English. Again, specify the "u" column: u:lie. However, the number of results is still large. If you want only four-syllable results, add ns:4. The entire search input is then u:lie ns:4
    • See #Technical notes for more details.

How to use the MLT segmenter

We describe how to use "Taiwanese–English dictionaries: MLT segmenter & full-text search" [2]. You might want to use this tool if you want to search the dictionaries using MLT but don't want to figure out the citation-tone syllables yourself. As most Taiwanese words written in MLT will not have a hyphen or other character to delimit syllable boundaries, computing the citation tone syllables is a non-trivial process. The MLT segmenter lowers the barrier between MLT and the dictionaries, which have not been completely converted to MLT.

To get started, enter your MLT word, then press "Go". The segmenter will process your input. If successful, it will also run a search. Results from HTB and DFT are displayed, and results from other dictionaries are summarized and linked to.

Typical usage

  • Input: Taiwanese word (typically disyllable: two syllables joined by tone sandhi)
    • Example: køefcie (if ø is not convenient, use 0 (zero) instead: k0efcie)
  • Press return or tap "Go"
    • your input is "unjoined" (original syllables found by database lookup)
      • in this example, the original syllables are: køea and cie
    • search is performed using the unordered collection of syllables (we refer to this as "bag-of-syllables" (BOS). see bag-of-words model)
    • confirm that the results are basically the same (except for HTB which is not unjoined) as if you had run a full-text search for either: køea cie, or: cie køea

Monosyllable

  • if the syllable is a DFT monosyllable, a navigation bar displays adjacent DFT monosyllables in alphabetical order
  • due to high number of matches, "monosyllable mode" displays monosyllable search results. To see all matching results, click on [[🔍 ]]

Other columns

  • The "en:" button will prepend "en:" to your search, causing the following token to be matched against the English column.
  • We haven't implemented Chinese text segmentation, which is non-trivial (see Chinese word-segmented writing).
  • DFT now supports using individual Harnji as tokens. For example, 對 頭. The h_j column is the Harnji (hj) column with spaces between characters.

Data

Local copies of:

Note: The M-fields of DFT and MK are largely machine-generated ("auto-joined") and do not attempt to indicate prescriptive spellings. In some cases, the common or recommended spelling may be different from what is shown. Often, the difference is about apostrophes and/or hyphens.

We also support searching other websites with conversion to POJ/TL:

Technical notes

Our full-text search is provided by the SQLite FTS4 extension. We currently use the Standard Query Syntax. One of the three basic query types supported by FTS tables is "token or token prefix queries":

  • Specify a token prefix by appending an asterisk ('*') to the prefix. (While similar to wildcard character in operating systems, wildcard search is not currently supported by FTS)
  • Specify a column-name followed by a colon (':')
    • Example: hj:頭* (returns entries where Taiwanese written with Harnji begins with character for thaau)
  • Prefix the token with carat ('^') to require token to be very first token in its column

Tokenizer: the default tokenizer ("simple") is used. Because it only does case folding of ASCII characters, Ø and ø do not match each other. Some words starting with Ø include Ørciw, Ørmngg, and Ørtøexli.

See also

Acknowledgements