~nishimotz/nvdajp/main

« back to all changes in this revision

Viewing changes to source/nvdajp_dic.py

  • Committer: Takuya Nishimoto
  • Date: 2012-10-17 04:22:30 UTC
  • Revision ID: nishimotz@gmail.com-20121017042230-xw1le47i0bew01tc
fixed regarding nvdajp ticket 29817

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        return s
25
25
 
26
26
# characters which use dictionary for spelling reading
27
 
SPECIAL_KANA_CHARACTERS = u'ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶァィゥェォャュョッをヲヲはへー'
 
27
SMALL_KANA_CHARACTERS = u'ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶァィゥェォャュョッ'
 
28
SPECIAL_KANA_CHARACTERS = SMALL_KANA_CHARACTERS + u'をヲヲはへー'
28
29
 
29
30
def isJapaneseLocale(locale):
30
31
        return locale[:2] == 'ja'
109
110
                                isLatinCharacter(c))))
110
111
        s = ''
111
112
        prevAttr = None
 
113
        prevChar = None
112
114
        for a in attrs:
113
115
                # symbols treated as 'attribute unchanged'
114
116
                if prevAttr and (prevAttr.hira or prevAttr.kata) and a[0] in (u'ー', u'、', u'。'):
115
 
                        s += a[0]
 
117
                        if a[0] == u'ー' and prevChar in SMALL_KANA_CHARACTERS:
 
118
                                s += ' ' + get_short_desc(a[0]) + ' '
 
119
                        else:
 
120
                                s += a[0]
116
121
                # attribute unchanged
117
122
                elif prevAttr == a[1]:
118
123
                        s += getCandidateCharDesc(a[0], a[1])
122
127
                                s += u' '
123
128
                        s += getAttrDesc(a[1]) + ' ' + getCandidateCharDesc(a[0], a[1])
124
129
                        prevAttr = a[1]
 
130
                prevChar = a[0]
125
131
        return s.lstrip()
126
132
 
127
133
dic1 = {