-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ThanatosDi/refactor/3.0
重構 3.0 版本
- Loading branch information
Showing
66 changed files
with
2,709 additions
and
61,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from enum import Enum | ||
|
||
|
||
class OpenccConverter(Enum): | ||
s2t = 's2t' | ||
s2tw = 's2tw' | ||
s2twp = 's2twp' | ||
t2s = 't2s' | ||
tw2s = 'tw2s' | ||
tw2sp = 'tw2sp' | ||
|
||
@classmethod | ||
def has_value(cls, value): | ||
return value in cls._value2member_map_ | ||
|
||
|
||
class FilenameConverter(Enum): | ||
s2t = 's2t' | ||
s2tw = 's2t' | ||
s2twp = 's2t' | ||
t2s = 't2s' | ||
tw2s = 't2s' | ||
tw2sp = 't2s' | ||
|
||
|
||
class FanhuajiConverter(Enum): | ||
s2t = 'Traditional' | ||
t2s = 'Simplified' | ||
s2tw = 'Traditional' | ||
s2twp = 'Taiwan' | ||
tw2s = 'Simplified' | ||
tw2sp = 'China' | ||
|
||
@classmethod | ||
def has_value(cls, value): | ||
return value in cls._value2member_map_ | ||
|
||
|
||
class Converter(Enum): | ||
s2t = 's2t' | ||
s2tw = 's2tw' | ||
s2twp = 's2twp' | ||
t2s = 't2s' | ||
tw2s = 'tw2s' | ||
tw2sp = 'tw2sp' | ||
|
||
@classmethod | ||
def has_name(cls, name): | ||
return name in cls._member_names_ | ||
|
||
|
||
class ConverterEnum(Enum): | ||
opencc = OpenccConverter | ||
fanhuaji = FanhuajiConverter | ||
filename = FilenameConverter | ||
converter = Converter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from enum import Enum | ||
|
||
|
||
class EngineEnum(Enum): | ||
fanhuaji = 'fanhuaji' | ||
fanhuaji_async = 'fanhuaji_async' | ||
opencc = 'opencc' | ||
|
||
@classmethod | ||
def has_value(cls, value): | ||
return value in cls._value2member_map_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from enum import Enum | ||
|
||
|
||
class FormatEnum(Enum): | ||
vertical = 'vertical' # 直書 | ||
horizontal = 'horizontal' # 橫書 | ||
|
||
@classmethod | ||
def has_value(cls, value): | ||
return value in cls._value2member_map_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__VERSION__ = '3.0.0' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import abc | ||
|
||
|
||
class Engine(abc.ABC): | ||
@abc.abstractmethod | ||
def convert(self, text, **kwargs): ... |
Oops, something went wrong.