1
# -*- coding: utf-8 -*-
4
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
7
# * KAKASI (Kanji Kana Simple inversion program)
8
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
10
# * Hironobu Takahashi (takahasi@tiny.or.jp)
12
# * This program is free software; you can redistribute it and/or modify
13
# * it under the terms of the GNU General Public License as published by
14
# * the Free Software Foundation; either versions 2, or (at your option)
15
# * any later version.
17
# * This program is distributed in the hope that it will be useful
18
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# * GNU General Public License for more details.
22
# * You should have received a copy of the GNU General Public License
23
# * along with KAKASI, see the file COPYING. If not, write to the Free
24
# * Software Foundation Inc., 59 Temple Place - Suite 330, Boston, MA
28
from calibre.ebooks.unihandecode.pykakasi.jisyo import jisyo
37
def isKatakana(self, char):
38
return ( 0x30a0 < ord(char) and ord(char) < 0x30f7)
40
def convert(self, text):
43
r = min(10, len(text)+1)
45
if text[:x] in self.kanwa.kanadict:
48
Hstr = self.kanwa.kanadict[text[:x]]
49
return (Hstr, max_len)