Skip to content

Commit

Permalink
Merge pull request #29 from camarm-dev/dev
Browse files Browse the repository at this point in the history
Ajout d'une documentation
  • Loading branch information
camarm-dev authored Nov 18, 2023
2 parents c58c517 + 043b9ef commit 2001141
Show file tree
Hide file tree
Showing 5 changed files with 350 additions and 133 deletions.
135 changes: 4 additions & 131 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Remède
Open Source and free alternative to Antidote.

[Data credits](#données-remède)[License](https://github.com/camarm-dev/remede/blob/main/LICENSE)
[Data credits](https://remede.camarm.fr/FR#données-remède)[License](https://github.com/camarm-dev/remede/blob/main/LICENSE)

</div>

Expand All @@ -20,12 +20,12 @@ Open Source and free alternative to Antidote.
- [x] Conjugaisons
- [x] Dans un doc Remède
- [x] Afficher
- [x] Référencer tous les mots (#21)
- [ ] Page de présentation
- [ ] Applications de bureaux
- [ ] Windows
- [ ] MAC
- [ ] Linux
- [ ] Référencer tous les mots (#21)
- [ ] API publique
- [ ] Mot du jour
- [x] Obtenir document d'un mot
Expand All @@ -37,133 +37,6 @@ Téléchargez les exécutables pour votre plateforme depuis [la page releases](/

SOON: Disponible sur Play Store

## Documentation

## Development

- Installer les dépendances
```shell
npm i
```
- Installer ionic
```shell
npm i -g @ionic/cli
```

### Application mobile

- Construire un fichier APK:
```shell
ionic cap build android
```

### Données Remède
Remède créé sa propre base de mots, synonymes, antonymes français à partir de services tiers.

- Les définitions par le [Wictionary français](https://fr.wiktionary.org/wiki/Wiktionnaire:Page_d%E2%80%99accueil), vie le wrapper de [Frederic Gainza](https://api-definition.fgainza.fr/) de l'API
- Les synonymes via [synonymo.fr](http://www.synonymo.fr)
- Les antonymes via [antonyme.org](http://www.antonyme.org)
- Les conjugaisons via [conjuguons.fr](http://www.conjuguons.fr)
- Les exemples de ???? (pas encore disponible)
- Les IPA de [Open Dict Data](https://github.com/open-dict-data/ipa-dict)

### Dataset

Le dossier `data` est destiné aux ressources linguistiques utilisées par Remède

`data/mots.txt`: Liste de 245 973 mots séparés de virgules

`data/ipa.json`: Pour une clé 'mot', renvoi l'IPA

`data/REMEDE_a.jon`: Le fichier d'indexation final (par lettre) ; pour une clé 'mot' renvoi [son document selon le schéma REMEDE](#schéma-de-document-remède)

`data/remede.db`: Une base sql ([référence](#base-sqlite))

### Schéma de document Remède
Schéma JSON d'un document de mot indexé par Remède

```json
{
"synonymes": [
""
],
"antonymes": [
""
],
"definitions": [
{
"genre": "",
"classe": "",
"explications": [
""
],
"exemples": [
""
]
}
],
"credits": {
"name": "page Wiktionnaire",
"url": ""
},
"image": {
"url": "",
"credits": ""
},
"ipa": "//",
"conjugaisons": {
"indicatif": {
"present": {
"je": "",
"tu": ""
}
}
}
}
```

- `synonymes` (`[]string`): Liste des mots synonymes
- `antonymes` (`[]string`): Liste des mots antonymes
- `definitions` (`[]{}`): Liste d'objets contenants une définition du mot
- `genre` (`string`): Genre du mot qui est défini
- `classe` (`string`): Classe grammaticale du mot défini
- `explications` (`[]string`): Listes des explications possibles de cette définition
- `exemples` (`[]string`): Listes des exemples d'utilisation du mot (NON IMPLÉMENTÉ)
- `credits` (`{}`): Objet contenant les crédits relatifs à la définition
- `name` (`string`): Nom de la source
- `url` (`string`): Url de la source
- `image` (`{}`): Objet contenant une image complémentaire à la définition
- `url` (`string`): Url de l'image
- `credits` (`string`): Url redirigeant vers les droits d'auteur de l'image
- `ipa` (`string`): Prononciation du mot selon l'International Phonetic Alphabet
- `conjugaisons` (`{}`): Objet contenant les conjugaisons du mot si c'est un verbe
- `[nom du mode]` (`{}`): Objet contenant les temps du mode
- `[nom du temps]` (`{}`): Objet contenant les formes verbales du temps
- `[sujet]` (`string`): Forme verbale du verbe (de `mode, temps, sujet`)

### API

- Installer python3
- Installer les dépendances
```shell
pip install fastapi uvicorn starlette
```
- Lancer le serveur
```shell
python3 server.py
```
En ligne sur [localhost:8000](http:/localhost:8000) !

Documentation sur [localhost:8000/docs](http:/localhost:8000/docs).

## Base sqlite

Le fichier `data/remede.db`, généré par le script `generate_sqlite.py` contient une base de données contenant tous les mots Remède.

Elle s'organise ainsi
- Une table `dictionary`

- Les champs
- word (`string`: le mot)
- document (`string`: le document Remède en format JSON)

Un questionnement se pose: se schéma n'étant pas propre (stocker du JSON dans une base sql), faut-il retranscrire complètement le schéma de document Remède en plusieurs tables dnas une base ?
La documentation est disponible sur [remede.camarm.fr](https://remede.camarm.fr)
167 changes: 167 additions & 0 deletions docs/EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@

# English Documentation

This page is also available in [french](/FR).

Welcome on the documentation page of Remède ! Navigate through the contents below

### Table of content

- [Development](#development)
- [Setup](#setting-up-development-environment)
- [Mobile application](#mobile-application)
- [Web application](#web-application)
- [API](#api)
- [Datas](#datas)
- [Remède's data](#remèdes-data)
- [Dataset](#dataset)
- [Remede document schema](#remède-document-schema)
- [Sqlite Database](#sqlite-database)

## Development

### Setting up development environment
- Install dependencies
```shell
npm i
```
- Install ionic
```shell
npm i -g @ionic/cli
```

### Mobile application

- Build the project for android:
```shell
ionic cap build android
```
- Then continue in Android Studio to build APK

### Web Application

This project uses [ionic](https://ionicframework.com/docs).

- Run the project
```shell
npm run dev
```


### API

- Install python3
- Install dependencies
```shell
pip install fastapi uvicorn starlette
```
- Start the server
```shell
python3 server.py
```
Running on [localhost:8000](http:/localhost:8000) !

Documentation available at [localhost:8000/docs](http:/localhost:8000/docs).

> [!NOTE]
> Please [generate the sqlite database](#sqlite-database) to serve the latest version of this one through the API !
## Datas

This section is destined to the data used and distributed by Remède.

### Remède's data
Remède creates is own base of french words, synonyms, antonyms with extern services.

- Definitions by the [french Wictionary](https://fr.wiktionary.org/wiki/Wiktionnaire:Page_d%E2%80%99accueil), with the API wrapper made by [Frederic Gainza](https://api-definition.fgainza.fr/).
- Synonyms from [synonymo.fr](http://www.synonymo.fr)
- Antonyms from [antonyme.org](http://www.antonyme.org)
- Conjugations from [conjuguons.fr](http://www.conjuguons.fr)
- Examples from ???? (not implemented)
- IPA from [Open Dict Data](https://github.com/open-dict-data/ipa-dict)

### Dataset

The `data` folder is destined to the linguistics ressources used by Remède.

`data/mots.txt`: List of 245 973 words, comma separated

`data/ipa.json`: For a key 'word', returns his IPA
- Generated from `data/IPA.txt`: a text file of format `[word]\t[ipa]`

`data/REMEDE_a.jon`: The final indexed file ; for a key 'word' returns [his document following the REMEDE schema](#remède-document-schema)

`data/remede.db`: A sqlite database ([reference](#sqlite-database))

### Remède document schema
JSON schema of an indexed word by Remède.

```json
{
"synonymes": [
""
],
"antonymes": [
""
],
"definitions": [
{
"genre": "",
"classe": "",
"explications": [
""
],
"exemples": [
""
]
}
],
"credits": {
"name": "page Wiktionnaire",
"url": ""
},
"image": {
"url": "",
"credits": ""
},
"ipa": "//",
"conjugaisons": {
"indicatif": {
"present": {
"je": "",
"tu": ""
}
}
}
}
```

- `synonymes` (`[]string`): List of synonyms
- `antonymes` (`[]string`): List of antonyms
- `definitions` (`[]{}`): List of objects containing a word definition
- `genre` (`string`): The 'genre' of defined word
- `classe` (`string`): The grammar class of defined word
- `explications` (`[]string`): List of possible explanation of defined word
- `exemples` (`[]string`): List of examples sentences using this word (NOT IMPLEMENTED)
- `credits` (`{}`): Object containing credits of the definitions
- `name` (`string`): Source name
- `url` (`string`): Source Url
- `image` (`{}`): object containing an image related to the definition
- `url` (`string`): Image Url
- `credits` (`string`): Credits Url
- `ipa` (`string`): International Phonetic Alphabet pronunciation of the word
- `conjugaisons` (`{}`): Object containing word's conjugations
- `[nom du mode]` (`{}`): Object containing conjugations' tenses for mode
- `[nom du temps]` (`{}`): Object containing subjects of tense
- `[sujet]` (`string`): Verbal form (of `mode, tense, subject`)

### Sqlite database

The file `data/remede.db`, generated by `generate_sqlite.py` contains a database of every indexed Remède word.

His schema is:
- A `dictionary` table

- With fields
- word (`string`: the mot)
- document (`string`: the Remède document in JSON format)
Loading

0 comments on commit 2001141

Please sign in to comment.