|
Open Chinese Convert 1.3.2+gad37fd0a6.dirty
A project for conversion between Traditional and Simplified Chinese
|
A Converter that passes text through a sequence of Converter stages in order, feeding the output of each stage as input to the next.
More...
#include <PipelineConverter.hpp>
Public Member Functions | |
| PipelineConverter (std::vector< ConverterPtr > stages) | |
| std::string | Convert (std::string_view text) const override |
Converts text and returns the result. | |
| ConversionInspectionResult | Inspect (std::string_view text) const override |
Returns an inspection result with input and output populated. | |
| SegmentationPtr | GetSegmentation () const override |
Returns the last stage's segmentation, or nullptr for an empty pipeline. | |
| ConversionChainPtr | GetConversionChain () const override |
Always returns nullptr; a pipeline has no single conversion chain. | |
A Converter that passes text through a sequence of Converter stages in order, feeding the output of each stage as input to the next.
This enables multi-step conversion schemes where different segmentation strategies or dictionary sets are needed at each step. For example, the s2twp config first converts Simplified to Traditional (stage 1) and then applies Taiwan-specific phrase substitution (stage 2).
GetConversionChain() always returns nullptr because a pipeline has no single chain. GetSegmentation() returns the last stage's segmentation as a best-effort representative.
|
inlineexplicit |
| stages | Ordered list of converters to apply in sequence. |
|
overridevirtual |
Converts text and returns the result.
| text | UTF-8 input; need not be null-terminated. |
Implements opencc::Converter.
|
inlineoverridevirtual |
Always returns nullptr; a pipeline has no single conversion chain.
Implements opencc::Converter.
|
overridevirtual |
Returns the last stage's segmentation, or nullptr for an empty pipeline.
Implements opencc::Converter.
|
overridevirtual |
Returns an inspection result with input and output populated.
Per-stage segment detail is not available at the pipeline level.
Implements opencc::Converter.