Class Japanese.KanjiReadings
A system for romanizing Kanji characters.
For more information, visit:
https://en.wikipedia.org/wiki/Kanji
Inheritance
Namespace: Romanization
Assembly: Romanization.NET.dll
Syntax
public sealed class KanjiReadings : object, IReadingsSystem<Japanese.KanjiReadings.ReadingTypes>, IRomanizationSystem
Constructors
| Improve this Doc View SourceKanjiReadings()
Instantiates a copy of the system to process romanizations.
Declaration
public KanjiReadings()
Properties
| Improve this Doc View SourceType
The type of the system - this is an important consideration depending on the purpose of romanizing the text.
For more information, visit:
https://en.wikipedia.org/wiki/Romanization#Methods
Declaration
public SystemType Type { get; }
Property Value
Type | Description |
---|---|
SystemType |
Methods
| Improve this Doc View SourceProcess(String)
Performs romanization of all Kanji in the given text.
Uses the first reading of the character - Kun'yomi first, if available, then On'yomi.
If more readings are required, use ProcessWithReadings(String) instead.
Declaration
public string Process(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to romanize. |
Returns
Type | Description |
---|---|
System.String | A romanized version of the text, leaving unrecognized characters untouched. Note that all romanized text will be lowercase. |
Process(String, Japanese.KanjiReadings.ReadingTypes)
Performs romanization of all Kanji in the given text.
Uses the first reading of the character - Kun'yomi first, if requested and available, then On'yomi if requested and available.
If more readings are required, use ProcessWithReadings(String, Japanese.KanjiReadings.ReadingTypes) instead.
Declaration
public string Process(string text, Japanese.KanjiReadings.ReadingTypes readingsToUse)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to romanize. |
Japanese.KanjiReadings.ReadingTypes | readingsToUse | The reading types to use. |
Returns
Type | Description |
---|---|
System.String | A romanized version of the text, leaving unrecognized characters untouched. Note that all romanized text will be lowercase. |
ProcessWithKana(String, IRomanizationSystem)
Performs romanization of all Kanji in the given text, after using system
to handle the kana.
system
defaults to Japanese.ModifiedHepburn if left as null.
See the documentation for Process(String) and the chosen system for more implementation details.
Declaration
public string ProcessWithKana(string text, IRomanizationSystem system = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to romanize. |
IRomanizationSystem | system | The system to romanize the kana in |
Returns
Type | Description |
---|---|
System.String | A romanized version of the text, leaving unrecognized characters untouched. Note that all romanized text will be lowercase. |
ProcessWithReadings(String)
Performs romanization of all Kanji in the given text.
Returns a collection of all the characters in text
, but with all readings (pronunciations) of each.
Returns the following readings for characters if they exist: Kun'yomi and On'yomi.
Declaration
public ReadingsString<Japanese.KanjiReadings.ReadingTypes> ProcessWithReadings(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to romanize. |
Returns
Type | Description |
---|---|
ReadingsString<Japanese.KanjiReadings.ReadingTypes> | A ReadingsString<TType> with all readings for each character in |
ProcessWithReadings(String, Japanese.KanjiReadings.ReadingTypes)
Performs romanization of all Kanji in the given text.
Returns a collection of all the characters in text
, but with all readings (pronunciations) of each.
Can return the following readings for characters if in readingsToUse
and they exist: Kun'yomi and On'yomi.
Declaration
public ReadingsString<Japanese.KanjiReadings.ReadingTypes> ProcessWithReadings(string text, Japanese.KanjiReadings.ReadingTypes readingsToUse)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to romanize. |
Japanese.KanjiReadings.ReadingTypes | readingsToUse | The reading types to use. |
Returns
Type | Description |
---|---|
ReadingsString<Japanese.KanjiReadings.ReadingTypes> | A ReadingsString<TType> with all readings for each character in |