Skip to content

Commit 0c66401

Browse files
authored
Update to v0.5.1
1 parent 2880f93 commit 0c66401

File tree

7 files changed

+58
-23
lines changed

7 files changed

+58
-23
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ conjuguer — conjugaison des verbes Francais
1111
\[-c|--columns NUM\]
1212
\[-d|--dictionary PATH\]
1313
\[-n|--nocolor\]
14-
\[-D|--DELA\]
1514
\[-A|--ABU\]
15+
\[-D|--DELA\]
1616
\[--debug\]
1717
\[--help|-?\]
1818
\[--locale LANG\]
@@ -33,14 +33,16 @@ The dictionary will be selected from the *DICTPATH* environment variable,
3333
or obtained from the *-d|--dictionary* option if used.
3434
The dictionary type is automatically detected.
3535

36+
You can convert entries from a dictionary format to the other, using the *-A|--ABU* and *-D|--DELA* options.
37+
3638
### OPTIONS
3739
Options | Use
3840
------- | ---
3941
-c\|--columns NUM|Choose number of columns to display between 1, 2 or 4
4042
-d\|--dictionary PATH|Select a specific dictionary
4143
-n\|--nocolor|Disable color output
42-
-D\|--DELA|Enable DELA format output
4344
-A\|--ABU|Enable ABU format output
45+
-D\|--DELA|Enable DELA format output
4446
--debug|Enable debug mode
4547
--help\|-?|Print usage and a short help message and exit
4648
--locale LANG|Override environment to select another language
@@ -92,6 +94,8 @@ The results are only as good (or bad) as what's included in the dictionary used.
9294
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs...
9395
I do not know yet the proportion of correct conjugations.
9496

97+
When converting from a dictionary format to the other, you'll lose semantics information (such a +z1, +AE, etc.).
98+
9599
## BUGS
96100
There are probably lots of peculiarities that would need specific processing,
97101
the verbs conjugated with the "être" auxiliary when used with a pronoun for example.

man/conjuguer.1

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
.Op Fl c|--columns Ar NUM
1010
.Op Fl d|--dictionary Ar PATH
1111
.Op Fl n|--nocolor
12-
.Op Fl D|--DELA
1312
.Op Fl A|--ABU
13+
.Op Fl D|--DELA
1414
.Op Fl -debug
1515
.Op Fl -help|-?
1616
.Op Fl -locale Ar LANG
@@ -38,6 +38,12 @@ The dictionary will be selected from the
3838
environment variable, or obtained from the
3939
.Fl d|--dictionary
4040
option if used. The dictionary type is automatically detected.
41+
.Pp
42+
You can convert entries from a dictionary format to the other, using the
43+
.Fl A|--ABU
44+
and
45+
.Fl D|--DELA
46+
options.
4147
.Ss OPTIONS
4248
.Op Fl c|--columns Ar NUM
4349
Choose number of columns to display between 1, 2 or 4
@@ -48,12 +54,12 @@ Select a specific dictionary
4854
.Op Fl n|--nocolor
4955
Disable color output
5056
.Pp
51-
.Op Fl D|--DELA
52-
Enable DELA format output
53-
.Pp
5457
.Op Fl A|--ABU
5558
Enable ABU format output
5659
.Pp
60+
.Op Fl D|--DELA
61+
Enable DELA format output
62+
.Pp
5763
.Op Fl -debug
5864
Enable debug mode
5965
.Pp
@@ -121,6 +127,8 @@ for stripping ANSI sequences in strings.
121127
The results are only as good (or bad) as what's included in the dictionary used.
122128
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs...
123129
I do not know yet the proportion of correct conjugations.
130+
.Pp
131+
When converting from a dictionary format to the other, you'll lose semantics information (such a +z1, +AE, etc.).
124132
.Sh BUGS
125133
There are probably lots of peculiarities that would need specific processing,
126134
the verbs conjugated with the "etre" auxiliary when used with a pronoun for example.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = pnu_conjuguer
33
description = conjugaison des verbes Français
44
long_description = file: README.md
55
long_description_content_type = text/markdown
6-
version = 0.5.0
6+
version = 0.5.1
77
license = BSD 3-Clause License
88
license_files = License
99
author = Hubert Tournier

src/conjuguer/main.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .blank import blank_verb
2222

2323
# Version string used by the what(1) and ident(1) commands:
24-
ID = "@(#) $Id: conjuguer - conjugaison des verbes Français v0.5.0 (October 3, 2021) by Hubert Tournier $"
24+
ID = "@(#) $Id: conjuguer - conjugaison des verbes Français v0.5.1 (October 10, 2021) by Hubert Tournier $"
2525

2626
# Default parameters. Can be overcome by environment variables, then command line options
2727
parameters = {
@@ -106,7 +106,7 @@ def display_help():
106106
print(_("usage: conjuguer [--debug] [--help|-?] [--locale LANG] [--version]"), file=sys.stderr)
107107
print(
108108
" "
109-
+ _("[-c|--columns NUMBER] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"),
109+
+ _("[-c|--columns NUMBER] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"),
110110
file=sys.stderr
111111
)
112112
print(" " + _("[-d|--dictionary PATH]"), file=sys.stderr)
@@ -121,8 +121,8 @@ def display_help():
121121
)
122122
print(" " + _("-d|--dictionary PATH Select a specific dictionary"), file=sys.stderr)
123123
print(" " + _("-n|--nocolor Disable color output"), file=sys.stderr)
124-
print(" " + _("-D|--DELA Enable DELA format output"), file=sys.stderr)
125124
print(" " + _("-A|--ABU Enable ABU format output"), file=sys.stderr)
125+
print(" " + _("-D|--DELA Enable DELA format output"), file=sys.stderr)
126126
print(" " + _("--debug Enable debug mode"), file=sys.stderr)
127127
print(
128128
" " + _("--help|-? Print usage and this help message and exit"),
@@ -531,6 +531,9 @@ def fill_verb_from_abu_dictionary_data(verb, conjugations, auxiliary):
531531
number = ""
532532
person = ""
533533
gender = ""
534+
if len(part) == 1:
535+
number = "s"
536+
gender = "m"
534537
if len(part) >= 2:
535538
if part[1] == "SG":
536539
number = "s"
@@ -1008,6 +1011,15 @@ def print_ABU_inflections(verb):
10081011
print("{} {} Ver{}".format(key, verb["Infinitif"]["Présent"], inflected_verb[key]))
10091012

10101013

1014+
################################################################################
1015+
def escape_DELA_special_characters(verb):
1016+
"""Escape "-", "," and "." characters with a backslash"""
1017+
verb = verb.replace("-", "\\-")
1018+
verb = verb.replace(",", "\\,")
1019+
verb = verb.replace(".", "\\.")
1020+
return verb
1021+
1022+
10111023
################################################################################
10121024
def print_DELA_inflections(verb):
10131025
"""Print a verb conjugations in DELA format"""
@@ -1034,9 +1046,20 @@ def print_DELA_inflections(verb):
10341046

10351047
for key in inflected_verb.keys():
10361048
if key == verb["Infinitif"]["Présent"]:
1037-
print("{},.V{}".format(key, inflected_verb[key]))
1049+
print(
1050+
"{},.V{}".format(
1051+
escape_DELA_special_characters(key),
1052+
inflected_verb[key]
1053+
)
1054+
)
10381055
else:
1039-
print("{},{}.V{}".format(key, verb["Infinitif"]["Présent"], inflected_verb[key]))
1056+
print(
1057+
"{},{}.V{}".format(
1058+
escape_DELA_special_characters(key),
1059+
escape_DELA_special_characters(verb["Infinitif"]["Présent"]),
1060+
inflected_verb[key]
1061+
)
1062+
)
10401063

10411064

10421065
################################################################################

src/conjuguer/po/conjuguer.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#, fuzzy
88
msgid ""
99
msgstr ""
10-
"Project-Id-Version: conjuguer 0.5.0\n"
10+
"Project-Id-Version: conjuguer 0.5.1\n"
1111
"Report-Msgid-Bugs-To: hubert.tournier@gmail.com\n"
1212
"POT-Creation-Date: 2021-09-19 10:30:+0200\n"
13-
"PO-Revision-Date: 2021-10-03 23:26:+0200\n"
13+
"PO-Revision-Date: 2021-10-10 08:32:+0200\n"
1414
"Last-Translator: Hubert Tournier <hubert.tournier@gmail.com>\n"
1515
"Language-Team: \n"
1616
"Language: en\n"
@@ -24,7 +24,7 @@ msgstr ""
2424
msgid "usage: conjuguer [--debug] [--help|-?] [--locale LANG] [--version]"
2525
msgstr ""
2626

27-
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"
27+
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"
2828
msgstr ""
2929

3030
msgid "[-d|--dictionary PATH]"

src/conjuguer/po/en/conjuguer.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: conjuguer 0.5.0\n"
9+
"Project-Id-Version: conjuguer 0.5.1\n"
1010
"Report-Msgid-Bugs-To: hubert.tournier@gmail.com\n"
1111
"POT-Creation-Date: 2021-09-19 10:30:+0200\n"
12-
"PO-Revision-Date: 2021-10-03 23:27+0200\n"
12+
"PO-Revision-Date: 2021-10-10 08:34+0200\n"
1313
"Last-Translator: Hubert Tournier <hubert.tournier@gmail.com>\n"
1414
"Language-Team: English\n"
1515
"Language: en\n"
@@ -23,8 +23,8 @@ msgstr ""
2323
msgid "usage: conjuguer [--debug] [--help|-?] [--locale LANG] [--version]"
2424
msgstr "usage: conjuguer [--debug] [--help|-?] [--locale LANG] [--version]"
2525

26-
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"
27-
msgstr "[-c|--columns NUMBER] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"
26+
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"
27+
msgstr "[-c|--columns NUMBER] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"
2828

2929
msgid "[-d|--dictionary PATH]"
3030
msgstr "[-d|--dictionary PATH]"

src/conjuguer/po/fr/conjuguer.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: conjuguer 0.5.0\n"
9+
"Project-Id-Version: conjuguer 0.5.1\n"
1010
"Report-Msgid-Bugs-To: hubert.tournier@gmail.com\n"
1111
"POT-Creation-Date: 2021-09-19 10:30:+0200\n"
12-
"PO-Revision-Date: 2021-10-03 23:28+0200\n"
12+
"PO-Revision-Date: 2021-10-10 08:34+0200\n"
1313
"Last-Translator: Hubert Tournier <hubert.tournier@gmail.com>\n"
1414
"Language-Team: French <traduc@traduc.org>\n"
1515
"Language: fr\n"
@@ -23,8 +23,8 @@ msgstr ""
2323
msgid "usage: conjuguer [--debug] [--help|-?] [--locale LANG] [--version]"
2424
msgstr "usage: conjuguer [--debug] [--help|-?] [--locale LANGUE] [--version]"
2525

26-
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"
27-
msgstr "[-c|--columns NOMBRE] [-n|--nocolor] [-D|--DELA] [-A|--ABU]"
26+
msgid "[-c|--columns NUMBER] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"
27+
msgstr "[-c|--columns NOMBRE] [-n|--nocolor] [-A|--ABU] [-D|--DELA]"
2828

2929
msgid "[-d|--dictionary PATH]"
3030
msgstr "[-d|--dictionary CHEMIN]"

0 commit comments

Comments
 (0)