Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create Phone class #15

Open
myedibleenso opened this issue Jun 15, 2021 · 0 comments
Open

create Phone class #15

myedibleenso opened this issue Jun 15, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@myedibleenso
Copy link
Contributor

Consider adding a Phone class and translation support:

from abc import ABC, ABCMeta, abstractmethod
from enum import Enum, EnumMeta
from typing import Text


class ABCEnumMeta(ABCMeta, EnumMeta):
    pass

class Phone(ABC):

    @property
    @abstractmethod
    def namespace(self) -> Text:
      pass

    @property
    @abstractmethod
    def is_vowel(self) -> bool:
      pass

class Arpabet(Phone, Enum, metaclass=ABCEnumMeta):
    EH01 = "EH01" 
    # ...

    @property
    def namespace(self) -> Text:
        return "arpabet"

    @property
    def is_vowel(self) -> bool:
        return True if self.value[-1] in { "1", "0", "2" } else False
@myedibleenso myedibleenso added the enhancement New feature or request label Jun 15, 2021
@myedibleenso myedibleenso self-assigned this Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant