|
Open Chinese Convert 1.3.2+gad37fd0a6.dirty
A project for conversion between Traditional and Simplified Chinese
|
Abstract base for full-text converters. More...
#include <Converter.hpp>
Public Member Functions | |
| virtual std::string | Convert (std::string_view text) const =0 |
Converts text and returns the result. | |
| virtual ConversionInspectionResult | Inspect (std::string_view text) const =0 |
Converts text and returns a detailed inspection result that includes the initial segmentation, per-stage intermediate segments, and final output. | |
| virtual SegmentationPtr | GetSegmentation () const =0 |
Returns the segmentation used by this converter, or nullptr if the converter has no single segmentation (e.g. | |
| virtual ConversionChainPtr | GetConversionChain () const =0 |
Returns the conversion chain used by this converter, or nullptr if the converter has no single chain (e.g. | |
Abstract base for full-text converters.
A Converter accepts a complete UTF-8 string and returns the converted result. Internally it coordinates Segmentation (splitting text into words) and a ConversionChain (applying one or more dictionaries to each segment). Two concrete implementations are provided:
SingleStageConverter — one segmentation pass + one ConversionChain.PipelineConverter — passes text through a sequence of Converter stages in order, each with its own segmentation and chain.
|
pure virtual |
Converts text and returns the result.
| text | UTF-8 input; need not be null-terminated. |
Implemented in opencc::PipelineConverter, and opencc::SingleStageConverter.
|
pure virtual |
Returns the conversion chain used by this converter, or nullptr if the converter has no single chain (e.g.
Implemented in opencc::PipelineConverter, and opencc::SingleStageConverter.
|
pure virtual |
Returns the segmentation used by this converter, or nullptr if the converter has no single segmentation (e.g.
Implemented in opencc::PipelineConverter, and opencc::SingleStageConverter.
|
pure virtual |
Converts text and returns a detailed inspection result that includes the initial segmentation, per-stage intermediate segments, and final output.
Intended for debugging and tooling rather than production conversion.
Implemented in opencc::PipelineConverter, and opencc::SingleStageConverter.