1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """This module represents Khmer language.
23
24 For more information, see U{http://en.wikipedia.org/wiki/Khmer_language}
25 """
26
27 import re
28
29 from translate.lang import common
30
31 -class km(common.Common):
32 """This class represents Khmer."""
33 code = "km"
34 fullname = "Khmer"
35 nplurals = 1
36 pluralequation = "0"
37
38 khmerpunc = u"។៕៖៘"
39 """These marks are only used for Khmer."""
40
41 punctuation = u"".join([common.Common.commonpunc, common.Common.quotes, common.Common.miscpunc, khmerpunc])
42
43 sentenceend = u"!?…។៕៘"
44
45 sentencere = re.compile(r"""(?s) #make . also match newlines
46 .*? #anything, but match non-greedy
47 [%s] #the puntuation for sentence ending
48 \s+ #the spacing after the puntuation
49 (?=[^a-z\d])#lookahead that next part starts with caps
50 """ % sentenceend, re.VERBOSE)
51
52 puncdict = {
53 u".": u"\u00a0។",
54 u":": u"\u00a0៖",
55 u"!": u"\u00a0!",
56 u"?": u"\u00a0?",
57 }
58
59 ignoretests = ["startcaps", "simplecaps"]
60