|
Open Chinese Convert 1.3.2
A project for conversion between Traditional and Simplified Chinese
|
A high-level converter. More...
#include <SimpleConverter.hpp>
Public Member Functions | |
| SimpleConverter (const std::string &configFileName) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, const ConfigLoadOptions &options) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths, const ConfigLoadOptions &options) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths, const char *argv0) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, const std::vector< std::string > &paths, const char *argv0, const ConfigLoadOptions &options) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, std::shared_ptr< ResourceProvider > provider) | |
| Constructor of SimpleConverter. | |
| SimpleConverter (const std::string &configFileName, std::shared_ptr< ResourceProvider > provider, const ConfigLoadOptions &options) | |
| Constructor of SimpleConverter. | |
| std::string | Convert (const std::string &input) const |
| Converts a text. | |
| std::string | Convert (std::string_view input) const |
| Converts a text without requiring a null-terminated buffer. | |
| std::string | Convert (const char *input) const |
| Converts a text. | |
| std::string | Convert (const char *input, size_t length) const |
| Converts a text. | |
| size_t | Convert (const char *input, char *output) const |
| Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space. | |
| size_t | Convert (const char *input, size_t length, char *output) const |
| Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space. | |
| ConversionInspectionResult | Inspect (std::string_view input) const |
| Inspects the conversion process for a given text. | |
A high-level converter.
|
explicit |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| const ConfigLoadOptions & | options ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| options | Configuration loading options. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| const std::vector< std::string > & | paths ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| paths | Additional paths to locate configuration and dictionary files. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| const std::vector< std::string > & | paths, | ||
| const ConfigLoadOptions & | options ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| paths | Additional paths to locate configuration and dictionary files. |
| options | Configuration loading options. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| const std::vector< std::string > & | paths, | ||
| const char * | argv0 ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| paths | Additional paths to locate configuration and dictionary files. |
| argv0 | Path of the executable (argv[0]), in addition to additional paths. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| const std::vector< std::string > & | paths, | ||
| const char * | argv0, | ||
| const ConfigLoadOptions & | options ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| paths | Additional paths to locate configuration and dictionary files. |
| argv0 | Path of the executable (argv[0]), in addition to additional paths. |
| options | Configuration loading options. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| std::shared_ptr< ResourceProvider > | provider ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| provider | Provider used to locate dictionary/resource files referenced by the configuration. |
| SimpleConverter::SimpleConverter | ( | const std::string & | configFileName, |
| std::shared_ptr< ResourceProvider > | provider, | ||
| const ConfigLoadOptions & | options ) |
Constructor of SimpleConverter.
| configFileName | File name of configuration. |
| provider | Provider used to locate dictionary/resource files referenced by the configuration. |
| options | Configuration loading options. |
| std::string SimpleConverter::Convert | ( | const char * | input | ) | const |
Converts a text.
| input | A C-Style std::string (terminated by '\0') to be converted. |
| size_t SimpleConverter::Convert | ( | const char * | input, |
| char * | output ) const |
Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.
| input | A C-Style std::string (terminated by '\0') to be converted. |
| output | Buffer to write the converted text. |
| std::string SimpleConverter::Convert | ( | const char * | input, |
| size_t | length ) const |
Converts a text.
| input | A C-Style std::string limited by a given length to be converted. |
| length | Maximal length in byte of the input std::string. |
| size_t SimpleConverter::Convert | ( | const char * | input, |
| size_t | length, | ||
| char * | output ) const |
Converts a text and writes to an allocated buffer Please make sure the buffer has sufficient space.
| input | A C-Style std::string limited by a given length to be converted. |
| length | Maximal length in byte of the input std::string. |
| output | Buffer to write the converted text. |
| std::string SimpleConverter::Convert | ( | const std::string & | input | ) | const |
Converts a text.
| input | Text to be converted. |
| std::string SimpleConverter::Convert | ( | std::string_view | input | ) | const |
Converts a text without requiring a null-terminated buffer.
New code should prefer this overload when a string_view is already available.
| input | Text to be converted. |
| ConversionInspectionResult SimpleConverter::Inspect | ( | std::string_view | input | ) | const |
Inspects the conversion process for a given text.
Returns the segmentation result, per-stage conversion outputs, and final output string.
| input | Text to be inspected. |