Chinese Pinyin
This commit is contained in:
parent
51cd39fe27
commit
c57877ce9a
46 changed files with 497243 additions and 151 deletions
|
|
@ -7,17 +7,17 @@ If you would like to contribute to the project by fixing a bug, adding a new lan
|
|||
- Finally, see what is the actual [contribution process](#contribution-process) and how to get your code merged.
|
||||
|
||||
## Building
|
||||
The recommended way of building is using Android Studio. The project is compatible with Android Studio Ladybug | 2024.2.1.
|
||||
The recommended way of building is using Android Studio. The project is compatible with Android Studio Meerkat | 2024.3.1.
|
||||
|
||||
### Building a Debug .apk
|
||||
If you have not configured Android Studio yet, follow [the official manual](https://developer.android.com/training/basics/firstapp), then follow the simple steps below to get the project running.
|
||||
|
||||
- _Import the project in Android Studio._
|
||||
- _Prevent the "Default Activity not found" issue._ If Android Studio fails to identify the default Activity, you must configure it not to launch anything after installing, otherwise it will fail with "Default Activity not found" or a similar message. To do so:
|
||||
- Open "Edit Configurations..." (Press Shift 3 times and select it from the command list)
|
||||
- Go to "General" tab.
|
||||
- Change "Launch Options" to "Nothing"
|
||||
- Hit "OK"
|
||||
- Open "Edit Configurations..." (Press Shift 3 times and select it from the command list)
|
||||
- Go to "General" tab.
|
||||
- Change "Launch Options" to "Nothing"
|
||||
- Hit "OK"
|
||||
|
||||
_You can find more info in this [Github issue](https://github.com/android/input-samples/issues/18)._
|
||||
|
||||
|
|
@ -57,11 +57,13 @@ To support a new language one needs to:
|
|||
- Keys 2 through 9, just contain the possible letters.
|
||||
- `abcString` _(optional)_. A custom string to display in ABC mode. By default, the first three letters on 2-key are used (e.g. "ABC" or "АБВ"). Set this if the first letters of the alphabet are _not_ on 2-key, like in Hebrew, or if a different string makes more sense.
|
||||
- `currency` _(optional)_. A string representing the currency related to that language, for example: `₪`, `₩`, `﷼`, etc. The character will be displayed in position 3 between the factory currency characters.
|
||||
- `filterBySounds` _(optional; requires `sounds`)_. For transcribed languages (e.g. Korean, Chinese), enables filtering by the Latin transcriptions. When it is set to `no` or missing, the filtering function and virtual key will be disabled. It has no effect for languages with alphabets, such as English, French, Polish, Arabic, Hindi, Bulgarian, etc.
|
||||
- `hasABC` _(optional)_. Disables ABC mode for this language. Useful for languages where the writing system is not an alphabet, such as East Asian languages. Default: `yes`.
|
||||
- `hasSpaceBetweenWords` _(optional)_ set to `no` when the language does not use spaces between words. For example: Thai, Chinese, Japanese, Korean, and so on. The default is `yes`.
|
||||
- `hasUpperCase` _(optional)_ set to `no` when the language has no upper- and lowercase letters. For example: Arabic, Hebrew, East Asian languages, and so on. The default is `yes`.
|
||||
- `name` _(optional)_ is automatically generated and equals the native name of the language (e.g. "English", "Deutsch", "Українська"). However, sometimes, the automatically selected name may be ambiguous. For example, both Portuguese in Portugal and Brazil will default to "Português", so assigning "Português brasileiro" would make it clear it's the language used in Brazil.
|
||||
-`numerals` _(optional)_ can be used to set a custom list of numerals. The list must contain exactly 10 characters equivalent to the digits from 0 to 9. For example, in Arabic you could use: `numerals: [٠,١,٢,٣,٤,٥,٦,٧,٨,٩]`.
|
||||
- `sounds` _(mandatory for non-alphabetic languages)_ is an array of elements in the format: `[sound,digits]`. It is used for East Asian or other languages where there are thousands of different characters, that can not be described in the layout property. `sounds` contains all possible vowel and consonant sounds and their respective digit combinations. There must be no repeating sounds. If a single Latin letter stands for a sound, the letter must be capital. If more than one letter is necessary to represent the sound, the first letter must be capital, while the rest must be small. For example, "A", "P", "Wo", "Ei", "Dd". The sounds are then used in the dictionary format with phonetic transcriptions. See `Korean.yml` and the respective dictionary file for an example.
|
||||
- `numerals` _(optional)_ can be used to set a custom list of numerals. The list must contain exactly 10 characters equivalent to the digits from 0 to 9. For example, in Arabic you could use: `numerals: [٠,١,٢,٣,٤,٥,٦,٧,٨,٩]`.
|
||||
- `sounds` _(mandatory for non-alphabetic languages)_ is an array of elements in the format: `[sound,digits]`. It is used for East Asian or other languages where there are thousands of different characters, that can not be described in the layout property. `sounds` contains all possible vowel and consonant sounds and their respective digit combinations. There must be no repeating sounds. If a single Latin letter stands for a sound, the letter must be capital. If more than one letter is necessary to represent the sound, the first letter must be capital, while the rest must be small. For example, "A", "P", "Wo", "Ei", "Dd". The sounds are then used in the dictionary format with phonetic transcriptions. See `ChinesePinyin.yml` and `Korean.yml` and the respective dictionary files for an example.
|
||||
|
||||
### Dictionary Formats
|
||||
|
||||
|
|
@ -113,6 +115,8 @@ Constraints:
|
|||
- The separator is `TAB`.
|
||||
- The first element is the language character or word
|
||||
- The second element is the phonetic representation with Latin letters. It must be a combination of the `sounds` in the respective YAML definition.
|
||||
- The third element, frequency, is optional. If missing, it is assumed to be 0.
|
||||
- The frequency must be an integer between 0 and 255, when present.
|
||||
|
||||
Example definition:
|
||||
```yaml
|
||||
|
|
@ -125,14 +129,14 @@ Example definition:
|
|||
|
||||
Example dictionary:
|
||||
```csv
|
||||
다 WeWo
|
||||
다 WeWo 45
|
||||
줘 TtWoWe
|
||||
와 Wo
|
||||
와 Wo 3
|
||||
```
|
||||
|
||||
Using the above example, when the user types "221-48-123", it will result in: "줘".
|
||||
|
||||
See `Korean.yml` and `ko-utf8.csv` for more examples.
|
||||
See `Korean.yml` with `ko-utf8.csv`, and `ChinesePinyin.yml` with `zh-pinyin.csv` for more examples.
|
||||
|
||||
## Merging Languages
|
||||
Traditional T9 does not officially support typing in more than one language simultaneously, and it will not provide such a possibility in the future. But if you are interested in a do-it-yourself solution, you can achieve it by merging the dictionaries for two (or more) languages into a new language. Follow the steps in [this discussion](https://github.com/sspanak/tt9/issues/713) about merging Czech and English. Just keep in mind: a) there can be no repeating words; b) it is not recommended to go over 2 million words, especially on low-end devices. Normal performance is not guaranteed beyond that limit.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue