Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
import .nop just once
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Apr 28, 2014
1 parent e6892b7 commit ca0ae28
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions pykakasi/kakasi.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def setMode(self, fr, to):
self._option[fr] = to

def getConverter(self):
from .nop import NOP

if self._mode["H"] == "a":
from .h2a import H2a
Expand All @@ -70,49 +71,41 @@ def getConverter(self):
from .h2k import H2K
self._hconv = H2K()
else:
from .nop import NOP
self._hconv = NOP()


if self._mode["K"] == "a":
from .k2a import K2a
self._kconv = K2a(method = self._option["r"])
elif self._mode["K"] == "h":
from .k2h import K2H
self._kconv = K2H()
else:
from .nop import NOP
self._kconv = NOP()


if self._mode["J"] == "a":
from .j2a import J2a
self._jconv = J2a(method = self._option["r"])
if self._flag["C"]:
self._separator = ' '
else:
self._separator = ''
elif self._mode["J"] == "h":
from .j2h import J2H
self._jconv = J2H()
if self._flag["C"]:
self._separator = ' '
else:
self._separator = ''
elif self._mode["J"] == "k":
from .j2k import J2k
self._jconv = J2k(method = self._option["r"])
if self._flag["C"]:
self._separator = ' '
else:
self._separator = ''
from .j2k import J2K
self._jconv = J2K(method = self._option["r"])
else:
self._jconv = NOP()

from .nop import NOP
if self._mode["a"] == None:
self._aconv = NOP()
else:
self._aconv = NOP()

if self._flag["C"]:
self._separator = ' '
else:
self._separator = ''

return self

def do(self, text):
Expand Down

0 comments on commit ca0ae28

Please sign in to comment.