-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ae9bbbd
Showing
11 changed files
with
1,450 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Copyright 2021+ Hubert Tournier | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
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. | ||
|
||
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. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
NAME=conjuguer | ||
SECTION=1 | ||
SOURCES=src/${NAME}/__init__.py src/${NAME}/main.py | ||
|
||
# Default action is to show this help message: | ||
.help: | ||
@echo "Possible targets:" | ||
@echo " check-code Verify PEP 8 compliance (lint)" | ||
@echo " check-security Verify security issues (audit)" | ||
@echo " check-unused Find unused code" | ||
@echo " check-version Find required Python version" | ||
@echo " check-sloc Count Single Lines of Code" | ||
@echo " checks Make all the previous tests" | ||
@echo " format Format code" | ||
@echo " package Build package" | ||
@echo " upload-test Upload the package to TestPyPi" | ||
@echo " upload Upload the package to PyPi" | ||
@echo " distclean Remove all generated files" | ||
|
||
check-code: /usr/local/bin/pylint | ||
-pylint ${SOURCES} | ||
|
||
lint: check-code | ||
|
||
check-security: /usr/local/bin/bandit | ||
-bandit -r ${SOURCES} | ||
|
||
audit: check-security | ||
|
||
check-unused: /usr/local/bin/vulture | ||
-vulture --sort-by-size ${SOURCES} | ||
|
||
check-version: /usr/local/bin/vermin | ||
-vermin ${SOURCES} | ||
|
||
check-sloc: /usr/local/bin/pygount | ||
-pygount --format=summary . | ||
|
||
checks: check-code check-security check-unused check-version check-sloc | ||
|
||
format: /usr/local/bin/black | ||
black ${SOURCES} | ||
|
||
love: | ||
@echo "Not war!" | ||
|
||
man/${NAME}.${SECTION}.gz: man/${NAME}.${SECTION} | ||
@gzip -k9c man/${NAME}.${SECTION} > man/${NAME}.${SECTION}.gz | ||
|
||
package: man/${NAME}.${SECTION}.gz | ||
python -m build | ||
|
||
upload-test: | ||
python -m twine upload --repository testpypi dist/* | ||
|
||
upload: | ||
python -m twine upload dist/* | ||
|
||
distclean: | ||
rm -rf build dist man/${NAME}.${SECTION}.gz src/*.egg-info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Installation | ||
pip install [pnu-conjuguer](https://pypi.org/project/pnu-conjuguer/) | ||
|
||
# CONJUGUER(1) | ||
|
||
## NAME | ||
conjuguer — conjugaison des verbes Francais | ||
|
||
## SYNOPSIS | ||
**conjuguer** | ||
\[-c|--columns NUM\] | ||
\[-d|--dictionary PATH\] | ||
\[-n|--nocolor\] | ||
\[--debug\] | ||
\[--help|-?\] | ||
\[--version\] | ||
\[--\] | ||
verb [...] | ||
|
||
## DESCRIPTION | ||
The **conjuguer** utility displays a French conjugation table for the verbs supplied on the command line. | ||
|
||
It will display the verb modes and tenses in color, unless you use the *-n|--nocolor* option. | ||
|
||
The display will be made in 4 columns, Bescherelle style (a famous verbs dictionary), | ||
or in 1 or 2 columns if you use the *-c|--columns* option. | ||
|
||
The data is obtained from a DELA or ABU type inflected French dictionary, rather than generated. | ||
The dictionary will be selected from the *DICTPATH* environment variable, | ||
or obtained from the *-d|--dictionary* option if used. | ||
The dictionary type is automatically detected. | ||
|
||
### OPTIONS | ||
Options | Use | ||
------- | --- | ||
-c\|--columns NUM|Choose number of columns to display between 1, 2 or 4 | ||
-d\|--dictionary PATH|Select a specific dictionary | ||
-n\|--nocolor|Disable color output | ||
--debug|Enable debug mode | ||
--help\|-?|Print usage and a short help message and exit | ||
--version|Print version and exit | ||
--|Options processing terminator | ||
|
||
## ENVIRONMENT | ||
The CONJUGUER_DEBUG environment variable can be set to any value to enable debug mode. | ||
|
||
The DICTPATH environment variable is searched for one of the default dictionary files. | ||
|
||
Alternatively, the CONJUGUER_DICT environment variable can also be set to the path of the dictionary file you want to use. | ||
|
||
## FILES | ||
The *dict-fr-DELA* file is the preferred dictionary used, if found in the *DICTPATH*. | ||
|
||
Else, the *dict-fr-ABU-mots_communs* file (which contains half of the verbs in the DELA) will be used instead. | ||
|
||
## EXIT STATUS | ||
The **conjuguer** utility exits 0 on success, and >0 if an error occurs. | ||
|
||
## SEE ALSO | ||
typo(1), | ||
spell(1), | ||
ispell(1), | ||
aspell(1), | ||
hunspell(1), | ||
dict(7) | ||
|
||
## STANDARDS | ||
The **conjuguer** utility is not a standard UNIX command. | ||
|
||
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. | ||
|
||
## HISTORY | ||
This utility was made for the [PNU project](https://github.com/HubTou/PNU), | ||
both as a way to test inflected dictionaries, and to validate the data inside. | ||
|
||
## LICENSE | ||
It is available under the [3-clause BSD license](https://opensource.org/licenses/BSD-3-Clause). | ||
|
||
## AUTHORS | ||
[Hubert Tournier](https://github.com/HubTou) | ||
|
||
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. | ||
|
||
## CAVEATS | ||
The results are only as good (or bad) as what's included in the dictionary used. | ||
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs... | ||
I do not know yet the proportion of correct conjugations. | ||
For example, "aimer" is OK, but "sortir" is horribly wrong! | ||
|
||
I do not have a French localized version yet, which is weird for a French language utility. | ||
|
||
## BUGS | ||
There are probably lots of peculiarities that would need specific processing, | ||
the verbs conjugated with the "etre" auxiliary for example. | ||
|
||
Though the software is probably mostly correct, I will consider it as Beta quality | ||
till I get a better idea of the quality of the source data and offer a way to improve it... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
.Dd August 31, 2021 | ||
.Dt CONJUGUER 1 | ||
.Os | ||
.Sh NAME | ||
.Nm conjuguer | ||
.Nd conjugaison des verbes Francais | ||
.Sh SYNOPSIS | ||
.Nm | ||
.Op Fl c|--columns Ar NUM | ||
.Op Fl d|--dictionary Ar PATH | ||
.Op Fl n|--nocolor | ||
.Op Fl -debug | ||
.Op Fl -help|-? | ||
.Op Fl -version | ||
.Op Fl - | ||
.Ar verb | ||
.Op Ar ... | ||
.Sh DESCRIPTION | ||
The | ||
.Nm | ||
utility displays a French conjugation table for the verbs supplied on the command line. | ||
.Pp | ||
It will display the verb modes and tenses in color, unless you use the | ||
.Fl n|--nocolor | ||
option. | ||
.Pp | ||
The display will be made in 4 columns, Bescherelle style (a famous verbs dictionary), | ||
or in 1 or 2 columns if you use the | ||
.Fl c|--columns | ||
option. | ||
.Pp | ||
The data is obtained from a DELA or ABU type inflected French dictionary, rather than generated. | ||
The dictionary will be selected from the | ||
.Ev DICTPATH | ||
environment variable, or obtained from the | ||
.Fl d|--dictionary | ||
option if used. The dictionary type is automatically detected. | ||
.Ss OPTIONS | ||
.Op Fl c|--columns Ar NUM | ||
Choose number of columns to display between 1, 2 or 4 | ||
.Pp | ||
.Op Fl d|--dictionary Ar PATH | ||
Select a specific dictionary | ||
.Pp | ||
.Op Fl n|--nocolor | ||
Disable color output | ||
.Pp | ||
.Op Fl -debug | ||
Enable debug mode | ||
.Pp | ||
.Op Fl -help|-? | ||
Print usage and this help message and exit | ||
.Pp | ||
.Op Fl -version | ||
Print version and exit | ||
.Pp | ||
.Op Fl - | ||
Options processing terminator | ||
.Sh ENVIRONMENT | ||
The | ||
.Ev CONJUGUER_DEBUG | ||
environment variable can be set to any value to enable debug mode. | ||
.Pp | ||
The | ||
.Ev DICTPATH | ||
environment variable is searched for one of the default dictionary files. | ||
.Pp | ||
Alternatively, the | ||
.Ev CONJUGUER_DICT | ||
environment variable can also be set to the path of the dictionary file you want to use. | ||
.Sh FILES | ||
The | ||
.Pa dict-fr-DELA | ||
file is the preferred dictionary used, if found in the | ||
.Ev DICTPATH . | ||
.Pp | ||
Else, the | ||
.Pa dict-fr-ABU-mots_communs | ||
file (which contains half of the verbs in the DELA) will be used instead. | ||
.Sh EXIT STATUS | ||
.Ex -std conjuguer | ||
.Sh SEE ALSO | ||
.Xr typo 1 | ||
.Xr spell 1 , | ||
.Xr ispell 1 , | ||
.Xr aspell 1 , | ||
.Xr hunspell 1 , | ||
.Xr dict 7 | ||
.Sh STANDARDS | ||
The | ||
.Nm | ||
utility is not a standard UNIX command. | ||
.Pp | ||
This utility tries to follow the PEP 8 style guide for Python code. | ||
.Sh HISTORY | ||
This utility was made for the | ||
.Lk https://github.com/HubTou/PNU PNU project | ||
both as a way to test inflected dictionaries, and to validate the data inside. | ||
.Sh LICENSE | ||
It is available under the 3-clause BSD license. | ||
.Sh AUTHORS | ||
.An Hubert Tournier | ||
.Pp | ||
The source code also includes a snippet of code from Martijn Pieters, | ||
for stripping ANSI sequences in strings. | ||
.Sh CAVEATS | ||
The results are only as good (or bad) as what's included in the dictionary used. | ||
The data in both the ABU and DELA dictionaries obviously contains errors, often on the same verbs... | ||
I do not know yet the proportion of correct conjugations. | ||
For example, "aimer" is OK, but "sortir" is horribly wrong! | ||
.Pp | ||
I do not have a French localized version yet, which is weird for a French language utility. | ||
.Sh BUGS | ||
There are probably lots of peculiarities that would need specific processing, | ||
the verbs conjugated with the "etre" auxiliary for example. | ||
.Pp | ||
Though the software is probably mostly correct, I will consider it as Beta quality till I get | ||
a better idea of the quality of the source data and offer a way to improve it... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[metadata] | ||
name = pnu_conjuguer | ||
description = conjugaison des verbes Français | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
version = 0.1.2 | ||
license = BSD 3-Clause License | ||
license_files = License | ||
author = Hubert Tournier | ||
author_email = nobody@nowhere.invalid | ||
url = https://github.com/HubTou/conjuguer/ | ||
project_urls = | ||
Bug Tracker = https://github.com/HubTou/conjuguer/issues | ||
keywords = pnu-project | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Environment :: Console | ||
Intended Audience :: Education | ||
Intended Audience :: End Users/Desktop | ||
License :: OSI Approved :: BSD License | ||
Natural Language :: English | ||
Natural Language :: French | ||
Operating System :: OS Independent | ||
Operating System :: POSIX :: BSD :: FreeBSD | ||
Operating System :: Microsoft :: Windows | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.0 | ||
Topic :: Education | ||
Topic :: Education :: Computer Aided Instruction (CAI) | ||
Topic :: Text Processing :: Linguistic | ||
Topic :: Utilities | ||
|
||
[options] | ||
package_dir = | ||
= src | ||
packages = find: | ||
python_requires = >=3.0 | ||
install_requires = | ||
colorama | ||
dict-fr-DELA | ||
dict-fr-ABU | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
conjuguer = conjuguer:main | ||
|
||
[options.data_files] | ||
man/man1 = | ||
man/conjuguer.1.gz | ||
|
Oops, something went wrong.