JapanesePhoneticAnalyzer
JapanesePhoneticAnalyzer
JapanesePhoneticAnalyzer
JapanesePhoneticAnalyzer
Class
Definition
Reads a Japanese string that is a combination of Kanji characters and Hiragana characters, and returns a collection of proper readings from the string with word breaks.
public : static class JapanesePhoneticAnalyzerpublic static class JapanesePhoneticAnalyzerPublic Static Class JapanesePhoneticAnalyzer// You can use this class in JavaScript.
- Attributes
| Device family |
Windows Desktop Extension SDK (introduced v10.0.10240.0)
|
| API contract |
Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract (introduced v1)
|
Remarks
Analyzing Japanese strings and generating readings and word breaks is not a straightforward task, as one Kanji character can be read in multiple ways depending on context. Japanese strings also don't have explicit word breaks such as whitespace. JapanesePhoneticAnalyzer breaks an input string into an IVectorView of JapanesePhoneme objects.
Each JapanesePhoneme object represents a single Japanese word, and has properties for its display, its "reading" (the pronunciation of the display string, represented by a sequence of Hiragana characters), and whether or not it is the start of a phrase.
Example
When the method JapanesePhoneticAnalyzer.GetWords(input) analyzes the string "今日はいい天気です", it returns a vector of JapanesePhoneme with these properties:
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| DisplayText | 今日 | は | いい | 天気 | です |
| YomiText (reading) | きょう | は | いい | てんき | です |
| IsPhraseStart | true | false | true | true | false |
You can also use the method overload JapanesePhoneticAnalyzer.GetWords(input, monoRuby) to specify the use of a word-breaking strategy called "Mono Ruby", which more aggressively attempts to break multi-Kanji words into multiple Kanji words. In the above example, using Mono Ruby, "天気" is further broken into "天" and "気". However, "今日" still remains unbroken due to the nature of the Japanese language.
Methods
GetWords(String) GetWords(String) GetWords(String) GetWords(String)
Reads a Japanese string that is a combination of Kanji characters and Hiragana characters, and returns a collection of proper readings from the string with word breaks.
public : static IVectorView<JapanesePhoneme> GetWords(PlatForm::String input)public static IReadOnlyList<JapanesePhoneme> GetWords(String input)Public Static Function GetWords(input As String) As IReadOnlyList( Of JapanesePhoneme )// You can use this method in JavaScript.
- input
- PlatForm::String String String String
A Japanese string that is a combination of Kanji characters and Hiragana characters.
A collection of JapanesePhoneme objects that represent proper readings from the string with word breaks.
- See Also
GetWords(String, Boolean) GetWords(String, Boolean) GetWords(String, Boolean) GetWords(String, Boolean)
Reads a Japanese string that is a combination of Kanji characters and Hiragana characters, and returns a collection of proper readings from the string with word breaks. Optionally uses the "Mono Ruby" strategy in breaking multi-Kanji words into multiple Kanji words.
public : static IVectorView<JapanesePhoneme> GetWords(PlatForm::String input, bool monoRuby)public static IReadOnlyList<JapanesePhoneme> GetWords(String input, Boolean monoRuby)Public Static Function GetWords(input As String, monoRuby As Boolean) As IReadOnlyList( Of JapanesePhoneme )// You can use this method in JavaScript.
- input
- PlatForm::String String String String
A Japanese string that is a combination of Kanji characters and Hiragana characters.
- monoRuby
- bool Boolean Boolean Boolean
Specifies the use of the word-breaking strategy "Mono Ruby". If true, the word-breaking strategy "Mono Ruby" is used. "Mono Ruby" more aggressively attempts to break multi-Kanji words into multiple Kanji words.
If false, "Mono Ruby" is not used.
A collection of JapanesePhoneme objects that represent proper readings from the string with word breaks.
- See Also