Skip to content

Commit ae9bbbd

Browse files
authored
Add files via upload
0 parents  commit ae9bbbd

File tree

11 files changed

+1450
-0
lines changed

11 files changed

+1450
-0
lines changed

License

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2021+ Hubert Tournier
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
NAME=conjuguer
2+
SECTION=1
3+
SOURCES=src/${NAME}/__init__.py src/${NAME}/main.py
4+
5+
# Default action is to show this help message:
6+
.help:
7+
@echo "Possible targets:"
8+
@echo " check-code Verify PEP 8 compliance (lint)"
9+
@echo " check-security Verify security issues (audit)"
10+
@echo " check-unused Find unused code"
11+
@echo " check-version Find required Python version"
12+
@echo " check-sloc Count Single Lines of Code"
13+
@echo " checks Make all the previous tests"
14+
@echo " format Format code"
15+
@echo " package Build package"
16+
@echo " upload-test Upload the package to TestPyPi"
17+
@echo " upload Upload the package to PyPi"
18+
@echo " distclean Remove all generated files"
19+
20+
check-code: /usr/local/bin/pylint
21+
-pylint ${SOURCES}
22+
23+
lint: check-code
24+
25+
check-security: /usr/local/bin/bandit
26+
-bandit -r ${SOURCES}
27+
28+
audit: check-security
29+
30+
check-unused: /usr/local/bin/vulture
31+
-vulture --sort-by-size ${SOURCES}
32+
33+
check-version: /usr/local/bin/vermin
34+
-vermin ${SOURCES}
35+
36+
check-sloc: /usr/local/bin/pygount
37+
-pygount --format=summary .
38+
39+
checks: check-code check-security check-unused check-version check-sloc
40+
41+
format: /usr/local/bin/black
42+
black ${SOURCES}
43+
44+
love:
45+
@echo "Not war!"
46+
47+
man/${NAME}.${SECTION}.gz: man/${NAME}.${SECTION}
48+
@gzip -k9c man/${NAME}.${SECTION} > man/${NAME}.${SECTION}.gz
49+
50+
package: man/${NAME}.${SECTION}.gz
51+
python -m build
52+
53+
upload-test:
54+
python -m twine upload --repository testpypi dist/*
55+
56+
upload:
57+
python -m twine upload dist/*
58+
59+
distclean:
60+
rm -rf build dist man/${NAME}.${SECTION}.gz src/*.egg-info
61+

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Installation
2+
pip install [pnu-conjuguer](https://pypi.org/project/pnu-conjuguer/)
3+
4+
# CONJUGUER(1)
5+
6+
## NAME
7+
conjuguer — conjugaison des verbes Francais
8+
9+
## SYNOPSIS
10+
**conjuguer**
11+
\[-c|--columns NUM\]
12+
\[-d|--dictionary PATH\]
13+
\[-n|--nocolor\]
14+
\[--debug\]
15+
\[--help|-?\]
16+
\[--version\]
17+
\[--\]
18+
verb [...]
19+
20+
## DESCRIPTION
21+
The **conjuguer** utility displays a French conjugation table for the verbs supplied on the command line.
22+
23+
It will display the verb modes and tenses in color, unless you use the *-n|--nocolor* option.
24+
25+
The display will be made in 4 columns, Bescherelle style (a famous verbs dictionary),
26+
or in 1 or 2 columns if you use the *-c|--columns* option.
27+
28+
The data is obtained from a DELA or ABU type inflected French dictionary, rather than generated.
29+
The dictionary will be selected from the *DICTPATH* environment variable,
30+
or obtained from the *-d|--dictionary* option if used.
31+
The dictionary type is automatically detected.
32+
33+
### OPTIONS
34+
Options | Use
35+
------- | ---
36+
-c\|--columns NUM|Choose number of columns to display between 1, 2 or 4
37+
-d\|--dictionary PATH|Select a specific dictionary
38+
-n\|--nocolor|Disable color output
39+
--debug|Enable debug mode
40+
--help\|-?|Print usage and a short help message and exit
41+
--version|Print version and exit
42+
--|Options processing terminator
43+
44+
## ENVIRONMENT
45+
The CONJUGUER_DEBUG environment variable can be set to any value to enable debug mode.
46+
47+
The DICTPATH environment variable is searched for one of the default dictionary files.
48+
49+
Alternatively, the CONJUGUER_DICT environment variable can also be set to the path of the dictionary file you want to use.
50+
51+
## FILES
52+
The *dict-fr-DELA* file is the preferred dictionary used, if found in the *DICTPATH*.
53+
54+
Else, the *dict-fr-ABU-mots_communs* file (which contains half of the verbs in the DELA) will be used instead.
55+
56+
## EXIT STATUS
57+
The **conjuguer** utility exits 0 on success, and >0 if an error occurs.
58+
59+
## SEE ALSO
60+
typo(1),
61+
spell(1),
62+
ispell(1),
63+
aspell(1),
64+
hunspell(1),
65+
dict(7)
66+
67+
## STANDARDS
68+
The **conjuguer** utility is not a standard UNIX command.
69+
70+
This utility tries to follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for [Python](https://www.python.org/) code.
71+
72+
## HISTORY
73+
This utility was made for the [PNU project](https://github.com/HubTou/PNU),
74+
both as a way to test inflected dictionaries, and to validate the data inside.
75+
76+
## LICENSE
77+
It is available under the [3-clause BSD license](https://opensource.org/licenses/BSD-3-Clause).
78+
79+
## AUTHORS
80+
[Hubert Tournier](https://github.com/HubTou)
81+
82+
The source code also includes a [snippet of code](https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python) from Martijn Pieters, for stripping ANSI sequences in strings.
83+
84+
## CAVEATS
85+
The results are only as good (or bad) as what's included in the dictionary used.
86+
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs...
87+
I do not know yet the proportion of correct conjugations.
88+
For example, "aimer" is OK, but "sortir" is horribly wrong!
89+
90+
I do not have a French localized version yet, which is weird for a French language utility.
91+
92+
## BUGS
93+
There are probably lots of peculiarities that would need specific processing,
94+
the verbs conjugated with the "etre" auxiliary for example.
95+
96+
Though the software is probably mostly correct, I will consider it as Beta quality
97+
till I get a better idea of the quality of the source data and offer a way to improve it...

man/conjuguer.1

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.Dd August 31, 2021
2+
.Dt CONJUGUER 1
3+
.Os
4+
.Sh NAME
5+
.Nm conjuguer
6+
.Nd conjugaison des verbes Francais
7+
.Sh SYNOPSIS
8+
.Nm
9+
.Op Fl c|--columns Ar NUM
10+
.Op Fl d|--dictionary Ar PATH
11+
.Op Fl n|--nocolor
12+
.Op Fl -debug
13+
.Op Fl -help|-?
14+
.Op Fl -version
15+
.Op Fl -
16+
.Ar verb
17+
.Op Ar ...
18+
.Sh DESCRIPTION
19+
The
20+
.Nm
21+
utility displays a French conjugation table for the verbs supplied on the command line.
22+
.Pp
23+
It will display the verb modes and tenses in color, unless you use the
24+
.Fl n|--nocolor
25+
option.
26+
.Pp
27+
The display will be made in 4 columns, Bescherelle style (a famous verbs dictionary),
28+
or in 1 or 2 columns if you use the
29+
.Fl c|--columns
30+
option.
31+
.Pp
32+
The data is obtained from a DELA or ABU type inflected French dictionary, rather than generated.
33+
The dictionary will be selected from the
34+
.Ev DICTPATH
35+
environment variable, or obtained from the
36+
.Fl d|--dictionary
37+
option if used. The dictionary type is automatically detected.
38+
.Ss OPTIONS
39+
.Op Fl c|--columns Ar NUM
40+
Choose number of columns to display between 1, 2 or 4
41+
.Pp
42+
.Op Fl d|--dictionary Ar PATH
43+
Select a specific dictionary
44+
.Pp
45+
.Op Fl n|--nocolor
46+
Disable color output
47+
.Pp
48+
.Op Fl -debug
49+
Enable debug mode
50+
.Pp
51+
.Op Fl -help|-?
52+
Print usage and this help message and exit
53+
.Pp
54+
.Op Fl -version
55+
Print version and exit
56+
.Pp
57+
.Op Fl -
58+
Options processing terminator
59+
.Sh ENVIRONMENT
60+
The
61+
.Ev CONJUGUER_DEBUG
62+
environment variable can be set to any value to enable debug mode.
63+
.Pp
64+
The
65+
.Ev DICTPATH
66+
environment variable is searched for one of the default dictionary files.
67+
.Pp
68+
Alternatively, the
69+
.Ev CONJUGUER_DICT
70+
environment variable can also be set to the path of the dictionary file you want to use.
71+
.Sh FILES
72+
The
73+
.Pa dict-fr-DELA
74+
file is the preferred dictionary used, if found in the
75+
.Ev DICTPATH .
76+
.Pp
77+
Else, the
78+
.Pa dict-fr-ABU-mots_communs
79+
file (which contains half of the verbs in the DELA) will be used instead.
80+
.Sh EXIT STATUS
81+
.Ex -std conjuguer
82+
.Sh SEE ALSO
83+
.Xr typo 1
84+
.Xr spell 1 ,
85+
.Xr ispell 1 ,
86+
.Xr aspell 1 ,
87+
.Xr hunspell 1 ,
88+
.Xr dict 7
89+
.Sh STANDARDS
90+
The
91+
.Nm
92+
utility is not a standard UNIX command.
93+
.Pp
94+
This utility tries to follow the PEP 8 style guide for Python code.
95+
.Sh HISTORY
96+
This utility was made for the
97+
.Lk https://github.com/HubTou/PNU PNU project
98+
both as a way to test inflected dictionaries, and to validate the data inside.
99+
.Sh LICENSE
100+
It is available under the 3-clause BSD license.
101+
.Sh AUTHORS
102+
.An Hubert Tournier
103+
.Pp
104+
The source code also includes a snippet of code from Martijn Pieters,
105+
for stripping ANSI sequences in strings.
106+
.Sh CAVEATS
107+
The results are only as good (or bad) as what's included in the dictionary used.
108+
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs...
109+
I do not know yet the proportion of correct conjugations.
110+
For example, "aimer" is OK, but "sortir" is horribly wrong!
111+
.Pp
112+
I do not have a French localized version yet, which is weird for a French language utility.
113+
.Sh BUGS
114+
There are probably lots of peculiarities that would need specific processing,
115+
the verbs conjugated with the "etre" auxiliary for example.
116+
.Pp
117+
Though the software is probably mostly correct, I will consider it as Beta quality till I get
118+
a better idea of the quality of the source data and offer a way to improve it...

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[metadata]
2+
name = pnu_conjuguer
3+
description = conjugaison des verbes Français
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
6+
version = 0.1.2
7+
license = BSD 3-Clause License
8+
license_files = License
9+
author = Hubert Tournier
10+
author_email = nobody@nowhere.invalid
11+
url = https://github.com/HubTou/conjuguer/
12+
project_urls =
13+
Bug Tracker = https://github.com/HubTou/conjuguer/issues
14+
keywords = pnu-project
15+
classifiers =
16+
Development Status :: 4 - Beta
17+
Environment :: Console
18+
Intended Audience :: Education
19+
Intended Audience :: End Users/Desktop
20+
License :: OSI Approved :: BSD License
21+
Natural Language :: English
22+
Natural Language :: French
23+
Operating System :: OS Independent
24+
Operating System :: POSIX :: BSD :: FreeBSD
25+
Operating System :: Microsoft :: Windows
26+
Programming Language :: Python :: 3
27+
Programming Language :: Python :: 3.0
28+
Topic :: Education
29+
Topic :: Education :: Computer Aided Instruction (CAI)
30+
Topic :: Text Processing :: Linguistic
31+
Topic :: Utilities
32+
33+
[options]
34+
package_dir =
35+
= src
36+
packages = find:
37+
python_requires = >=3.0
38+
install_requires =
39+
colorama
40+
dict-fr-DELA
41+
dict-fr-ABU
42+
43+
[options.packages.find]
44+
where = src
45+
46+
[options.entry_points]
47+
console_scripts =
48+
conjuguer = conjuguer:main
49+
50+
[options.data_files]
51+
man/man1 =
52+
man/conjuguer.1.gz
53+

0 commit comments

Comments
 (0)