main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf8 -*- |
---|
3 | # Plural-Forms for ca (Catalan) |
---|
4 | |
---|
5 | nplurals=2 # Catalan language has 2 forms: |
---|
6 | # 1 singular and 1 plural |
---|
7 | |
---|
8 | # Determine plural_id for number *n* as sequence of positive |
---|
9 | # integers: 0,1,... |
---|
10 | # NOTE! For singular form ALWAYS return plural_id = 0 |
---|
11 | get_plural_id = lambda n: int(n != 1) |
---|
12 | |
---|
13 | # Construct and return plural form of *word* using |
---|
14 | # *plural_id* (which ALWAYS>0). This function will be executed |
---|
15 | # for words (or phrases) not found in plural_dict dictionary |
---|
16 | construct_plural_form = lambda word, plural_id:(word[:-2] + 'gues' if word[-2:] == 'ga' else |
---|
17 | word[:-2] + 'ques' if word[-2:] == 'ca' else |
---|
18 | word[:-2] + 'ces' if word[-2:] == 'ça' else |
---|
19 | word[:-2] + 'ges' if word[-2:] == 'ja' else |
---|
20 | word[:-2] + 'ües' if word[-3:] in ('gua', 'qua') else |
---|
21 | word[:-1] + 'es' if word[-1:] == 'a' else |
---|
22 | word if word[-1:] == 's' else |
---|
23 | word + 's') |
---|
Note: See
TracBrowser
for help on using the repository browser.