Aracılığıyla paylaş


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 ref class JapanesePhoneticAnalyzer abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.STA)]
class JapanesePhoneticAnalyzer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.STA)]
public static class JapanesePhoneticAnalyzer
Public Class JapanesePhoneticAnalyzer
Inheritance
Object Platform::Object IInspectable JapanesePhoneticAnalyzer
Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
API contract
Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract (introduced in v1.0)

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, 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.

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.

Applies to

See also