|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.java.sen.ReadingProcessor
public class ReadingProcessor
A text processor that builds reading data suitable for application as
furigana. ReadingFilter
s can be used to refine
and customise the output
See examples.ReadingProcessorDemo in the Sen source for an example of how to use this class
Thread Safety: Objects of this class are NOT thread safe and
should not be accessed simultaneously by multiple threads. Note that creating
additional instances using SenFactory
is relatively cheap in both
memory and time
入れ子のクラスの概要 | |
---|---|
static class |
ReadingProcessor.ReadingResult
The result of reading processing. |
コンストラクタの概要 | |
---|---|
ReadingProcessor(Tokenizer tokenizer)
|
メソッドの概要 | |
---|---|
void |
addFilter(int priority,
ReadingFilter filter)
Adds a reading filter to be applied during processing |
void |
clearFilters()
Removes any previously set reading filters |
java.util.List<Reading> |
getDisplayReadings()
Returns a list of readings generated from the current text. |
java.util.Map<java.lang.Integer,ReadingFilter> |
getFilters()
Returns the complete set of reading filters currently applied during processing |
Reading |
getReadingConstraint(int position)
Gets a reading constraint set on the currently analysed text |
ReadingProcessor.ReadingResult |
process()
Performs full reading processing and returns a ReadingProcessor.ReadingResult object
isolated from further changes to the reading processor |
void |
removeFilter(int priority)
Removes the filter with the given priority, if it exists |
void |
removeReadingConstraint(int position)
Remove the reading constraint at the given position |
void |
setFilters(java.util.Map<java.lang.Integer,ReadingFilter> filters)
Sets all reading filters to be applied during processing. |
void |
setReadingConstraint(Reading constraint)
Sets a reading constraint on the currently analysed text. |
void |
setText(java.lang.String text)
Sets the currently analysed text. |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public ReadingProcessor(Tokenizer tokenizer)
tokenizer
- The Tokenizer to useメソッドの詳細 |
---|
public void setText(java.lang.String text)
reset()
method will
be invoked on any currently set filters in order to clear sentence
specific state
text
- The text to analysepublic void addFilter(int priority, ReadingFilter filter)
priority
- The precedence of the filter. Lower numbered filters are
applied first. If a filter is added with the same
priority as an existing filter, the existing filter will
be overwrittenfilter
- The filter to addpublic void removeFilter(int priority)
priority
- The priority of the filter to removepublic void setFilters(java.util.Map<java.lang.Integer,ReadingFilter> filters)
filters
- The filters to usepublic void clearFilters()
public java.util.Map<java.lang.Integer,ReadingFilter> getFilters()
public Reading getReadingConstraint(int position)
position
- The index within the sentence to get the constraint at
public void setReadingConstraint(Reading constraint)
constraint
- public void removeReadingConstraint(int position)
position
- The position from which to remove the constraintpublic java.util.List<Reading> getDisplayReadings()
process()
and then ReadingProcessor.ReadingResult.getDisplayReadings()
public ReadingProcessor.ReadingResult process()
ReadingProcessor.ReadingResult
object
isolated from further changes to the reading processor
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |