# Path: minette/models/wordnode.py
# class WordNode(ABC, Serializable):
#     """
#     Base class of parsed word
# 
#     Attributes
#     ----------
#     surface : str
#         Surface of word
#     part : str
#         Part of the word
#     part_detail1 : str
#         Detail1 of part
#     part_detail2 : str
#         Detail2 of part
#     part_detail3 : str
#         Detail3 of part
#     stem_type : str
#         Stem type
#     stem_form : str
#         Stem form
#     word : str
#         Word itself
#     kana : str
#         Japanese kana of the word
#     pronunciation : str
#         Pronunciation of the word
#     """
#     def __init__(self, surface, part, part_detail1, part_detail2, part_detail3,
#                  stem_type, stem_form, word, kana, pronunciation):
#         self.surface = surface
#         self.part = part
#         self.part_detail1 = part_detail1
#         self.part_detail2 = part_detail2
#         self.part_detail3 = part_detail3
#         self.stem_type = stem_type
#         self.stem_form = stem_form
#         self.word = word
#         self.kana = kana
#         self.pronunciation = pronunciation
# 
#     @classmethod
#     @abstractmethod
#     def create(cls, surface, features):
#         pass
# 
# Path: minette/tagger/base.py
# class Tagger:
#     """
#     Base class for word taggers
# 
#     Attributes
#     ----------
#     config : minette.Config
#         Configuration
#     timezone : pytz.timezone
#         Timezone
#     logger : logging.Logger
#         Logger
#     """
#     MAX_LENGTH = 1000
# 
#     def __init__(self, config=None, timezone=None, logger=None, *,
#                  max_length=MAX_LENGTH, **kwargs):
#         """
#         Parameters
#         ----------
#         config : Config, default None
#             Configuration
#         timezone : timezone, default None
#             Timezone
#         logger : Logger, default None
#             Logger
#         max_length : int, default 1000
#             Max length of the text to parse
#         """
#         self.config = config
#         self.timezone = timezone
#         self.logger = logger or getLogger(__name__)
#         self.max_length = max_length
# 
#     def validate(self, text, max_length=None):
#         if not text:
#             return False
#         elif max_length is not None:
#             if len(text) > max_length:
#                 return False
#         elif len(text) > self.max_length:
#             return False
# 
#         return True
# 
#     def parse_as_generator(self, text, max_length=None):
#         """
#         Analyze and parse text, returns Generator
# 
#         Parameters
#         ----------
#         text : str
#             Text to analyze
#         max_length : int, default None
#             Max length of the text to parse
# 
#         Returns
#         -------
#         words : Generator of minette.WordNode (empty)
#             Word nodes
#         """
#         yield from ()
# 
#     def parse(self, text, max_length=None):
#         """
#         Analyze and parse text
# 
#         Parameters
#         ----------
#         text : str
#             Text to analyze
#         max_length : int, default None
#             Max length of the text to parse
# 
#         Returns
#         -------
#         words : list of minette.WordNode (empty)
#             Word nodes
#         """
#         return [wn for wn in self.parse_as_generator(text, max_length)]


import traceback
from janome.tokenizer import Tokenizer
from ..models import WordNode
from .base import Tagger
        ps = features.part_of_speech.split(",")
        return cls(
            surface=surface,
            part=ps[0] if len(ps) > 1 and ps[0] != "*" else "",
            part_detail1=ps[1] if len(ps) > 2 and ps[1] != "*" else "",
            part_detail2=ps[2] if len(ps) > 3 and ps[2] != "*" else "",
            part_detail3=ps[3] if len(ps) > 4 and ps[3] != "*" else "",
            stem_type=features.infl_type if features.infl_type != "*" else "",
            stem_form=features.infl_form if features.infl_form != "*" else "",
            word=features.base_form if features.base_form != "*" else "",
            kana=features.reading if features.reading != "*" else "",
            pronunciation=features.phonetic if features.phonetic != "*" else ""
        )


class JanomeTagger(Tagger):
    """
    Tagger using Janome

    Attributes
    ----------
    config : minette.Config
        Configuration
    timezone : pytz.timezone
        Timezone
    logger : logging.Logger
        Logger
    """

    def __init__(self, config=None, timezone=None, logger=None, *,

# Path: minette/models/wordnode.py
# class WordNode(ABC, Serializable):
#     """
#     Base class of parsed word
# 
#     Attributes
#     ----------
#     surface : str
#         Surface of word
#     part : str
#         Part of the word
#     part_detail1 : str
#         Detail1 of part
#     part_detail2 : str
#         Detail2 of part
#     part_detail3 : str
#         Detail3 of part
#     stem_type : str
#         Stem type
#     stem_form : str
#         Stem form
#     word : str
#         Word itself
#     kana : str
#         Japanese kana of the word
#     pronunciation : str
#         Pronunciation of the word
#     """
#     def __init__(self, surface, part, part_detail1, part_detail2, part_detail3,
#                  stem_type, stem_form, word, kana, pronunciation):
#         self.surface = surface
#         self.part = part
#         self.part_detail1 = part_detail1
#         self.part_detail2 = part_detail2
#         self.part_detail3 = part_detail3
#         self.stem_type = stem_type
#         self.stem_form = stem_form
#         self.word = word
#         self.kana = kana
#         self.pronunciation = pronunciation
# 
#     @classmethod
#     @abstractmethod
#     def create(cls, surface, features):
#         pass
# 
# Path: minette/tagger/base.py
# class Tagger:
#     """
#     Base class for word taggers
# 
#     Attributes
#     ----------
#     config : minette.Config
#         Configuration
#     timezone : pytz.timezone
#         Timezone
#     logger : logging.Logger
#         Logger
#     """
#     MAX_LENGTH = 1000
# 
#     def __init__(self, config=None, timezone=None, logger=None, *,
#                  max_length=MAX_LENGTH, **kwargs):
#         """
#         Parameters
#         ----------
#         config : Config, default None
#             Configuration
#         timezone : timezone, default None
#             Timezone
#         logger : Logger, default None
#             Logger
#         max_length : int, default 1000
#             Max length of the text to parse
#         """
#         self.config = config
#         self.timezone = timezone
#         self.logger = logger or getLogger(__name__)
#         self.max_length = max_length
# 
#     def validate(self, text, max_length=None):
#         if not text:
#             return False
#         elif max_length is not None:
#             if len(text) > max_length:
#                 return False
#         elif len(text) > self.max_length:
#             return False
# 
#         return True
# 
#     def parse_as_generator(self, text, max_length=None):
#         """
#         Analyze and parse text, returns Generator
# 
#         Parameters
#         ----------
#         text : str
#             Text to analyze
#         max_length : int, default None
#             Max length of the text to parse
# 
#         Returns
#         -------
#         words : Generator of minette.WordNode (empty)
#             Word nodes
#         """
#         yield from ()
# 
#     def parse(self, text, max_length=None):
#         """
#         Analyze and parse text
# 
#         Parameters
#         ----------
#         text : str
#             Text to analyze
#         max_length : int, default None
#             Max length of the text to parse
# 
#         Returns
#         -------
#         words : list of minette.WordNode (empty)
#             Word nodes
#         """
#         return [wn for wn in self.parse_as_generator(text, max_length)]


# Path: minette/tagger/janometagger.py
import traceback
from janome.tokenizer import Tokenizer
from ..models import WordNode
from .base import Tagger

        ps = features.part_of_speech.split(",")
        return cls(
            surface=surface,
            part=ps[0] if len(ps) > 1 and ps[0] != "*" else "",
            part_detail1=ps[1] if len(ps) > 2 and ps[1] != "*" else "",
            part_detail2=ps[2] if len(ps) > 3 and ps[2] != "*" else "",
            part_detail3=ps[3] if len(ps) > 4 and ps[3] != "*" else "",
            stem_type=features.infl_type if features.infl_type != "*" else "",
            stem_form=features.infl_form if features.infl_form != "*" else "",
            word=features.base_form if features.base_form != "*" else "",
            kana=features.reading if features.reading != "*" else "",
            pronunciation=features.phonetic if features.phonetic != "*" else ""
        )


class JanomeTagger(Tagger):
    """
    Tagger using Janome

    Attributes
    ----------
    config : minette.Config
        Configuration
    timezone : pytz.timezone
        Timezone
    logger : logging.Logger
        Logger
    """

    def __init__(self, config=None, timezone=None, logger=None, *,

                 max_length=Tagger.MAX_LENGTH, user_dic=None, **kwargs):