-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial French grammar rules to insert articles to way names #252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical notes, but nothing grave.
languages/grammar/fr.json
Outdated
["^ All[ée]e ", " l’allée "], | ||
["^ (L['’])?Autoroute ", " l’autoroute "], | ||
["^ Avenue ", " l’avenue "], | ||
["^ Boulevard ", " la boulevard "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We say « le boulevard ».
languages/grammar/fr.json
Outdated
["^ (L['’])?Autoroute ", " l’autoroute "], | ||
["^ Avenue ", " l’avenue "], | ||
["^ Boulevard ", " la boulevard "], | ||
["^ Chemin ", " la chemin "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We say « le chemin ».
languages/grammar/fr.json
Outdated
["^ Cours ", " la cours "], | ||
["^ Entr[ée]e ", " l’entrée "], | ||
["^ Impasse ", " l’impasse "], | ||
["^ Parvis ", " la parvis "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark here.
languages/grammar/fr.json
Outdated
["^ Entr[ée]e ", " l’entrée "], | ||
["^ Impasse ", " l’impasse "], | ||
["^ Parvis ", " la parvis "], | ||
["^ Passage ", " la passage "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
languages/grammar/fr.json
Outdated
["^ Parvis ", " la parvis "], | ||
["^ Passage ", " la passage "], | ||
["^ Place ", " la place "], | ||
["^ Petit[\\- ]Pont ", " la petit-pont "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
languages/grammar/fr.json
Outdated
["^ Petit[\\- ]Pont ", " de la petit-pont "], | ||
["^ Pont ", " de la pont "], | ||
["^ Promenade ", " de la promenade "], | ||
["^ Quai ", " de la quai "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be more precise, it would be "du quai"
languages/grammar/fr.json
Outdated
["^ Route ", " de la route "], | ||
["^ Rue ", " de la rue "], | ||
["^ Sortie ", " de la sortie "], | ||
["^ Souterrain ", " de la souterrain "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"du souterrain"
languages/grammar/fr.json
Outdated
["^ Rue ", " de la rue "], | ||
["^ Sortie ", " de la sortie "], | ||
["^ Souterrain ", " de la souterrain "], | ||
["^ Square ", " de la square "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"du square"
languages/grammar/fr.json
Outdated
["^ Sortie ", " de la sortie "], | ||
["^ Souterrain ", " de la souterrain "], | ||
["^ Square ", " de la square "], | ||
["^ Tunnel ", " de la tunnel "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"du tunnel"
languages/grammar/fr.json
Outdated
["^ Tunnel ", " de la tunnel "], | ||
["^ Voie ", " de la voie "], | ||
|
||
["^ ([AÂÀEÈÉÊËHIÎÏOÔUÙÛÜYŸÆŒ])", " d’$1"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there is no real rule for elision before an h, so it can't be easily done apart with a list of all concerned words. I think you can remove it from this list and the other one. If you want to do it, here is a list of all h-beginning words which don't provoke an elision: https://fr.wikipedia.org/wiki/H_aspir%C3%A9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list looks too big to be inserted into this humble expressions array 😕 So it's really simpler just to exclude H from there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
There are a few instances of masculine vs. feminine nouns to correct that @Penegal already noted, otherwise that's good.
@Penegal is that test case correct? I'm not sure whether the capital letter should go or not:
['La Rochelle', 'elision', 'de la Rochelle']
If it is I think that's a test case that we should add.
@benjamintd: I would say the correct string would be This would have been different if the name was, for instance, |
I also notice that grammar rules should be applied on two other cases:
|
@Penegal, I need more detailed cases for replacing |
@yuryleb: |
languages/translations/fr.json
Outdated
"name": "Tourner {modifier} pour rester {way_name}", | ||
"destination": "Tourner {modifier} en direction de {destination}", | ||
"exit": "Tourner {modifier} sur {way_name}" | ||
"name": "Tourner {modifier} pour rester {way_name:article}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct translation would be Tourner {modifier} pour rester sur {way_name:article}
.
languages/translations/fr.json
Outdated
}, | ||
"uturn": { | ||
"default": "Faire demi-tour à la fin de la route", | ||
"name": "Faire demi-tour à la fin de la route {way_name}", | ||
"destination": "Faire demi-tour à la fin de la route en direction de {destination}" | ||
"name": "Faire demi-tour à la fin de la route {way_name:article}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct translation would be Faire demi-tour à la fin {way_name:elision}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction: Faire demi-tour à la fin de {way_name:article}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Faire demi-tour à la fin de le boulevard Saint-Germain
not Faire demi-tour à la fin du boulevard Saint-Germain
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the name of the classes should be changed for a more descriptive version? Both classes elide, but one for an article, le/la/les
, and the other for a preposition, de/des/du
; naming the second case preposition
could do it.
There could also be a redundancy in the computed instructions using the current rotary
strings, but this should be tested, as I don't know enough real-world examples of roundabout names to be sure of it.
Here is what I expected: the correct second instruction would be |
@Penegal, now Transifex's recently changed |
@yuryleb: you should go with |
@yuryleb: I just checked, and, according to an orthographic reform, rond-point can also be written rondpoint. Also note that I recently updated some Transifex strings; in case of conflict, you can drop the new ones. Just warn me to allow me to restore them. |
Yes, I can support both but what should be in final text - And actually I could also merge your changes from Transifex if you completed - anyway I download them every time I check how override script works 😉 |
The main orthograph is If you can merge the Transifex changes with the one you did, perfect! I have a backup of the first ones, if needed, and I finished my edits, so you can go and merge. |
I noticed you added way types in your regex list; there could also be le sentier, which is something like a feminine form of sente. |
It seems all is done. @Penegal, @benjamintd, do you have anything to add? |
@yuryleb: Edit: also, |
@Penegal, Formatting with bold typeface is part of external |
@Penegal, so an expression to exclude appended articles/prepositions should look like This expression will help to format as below:
Is it enough or all added words should be also non-bold to keep only cour d’Honneur bolded? |
@yuryleb: I would say the correct typography would be de la cour d’Honneur. |
@Penegal, please look how this is now implemented. |
@yuryleb: very good work. I'm OK with this. |
Is there a problem preventing an approving review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
languages/grammar/fr.json
Outdated
["^ Traverse ", " la traverse "], | ||
["^ Tunnel ", " le tunnel "], | ||
["^ Viaduc ", " le viaduc "], | ||
["^ Villa(ge)? ", " le villa$1 "], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we looking to match other than Village? Unfortunately Villa
is feminine in French (la villa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I add other rules for Villa
then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you all for your attention to detail!
How often is the code of map.project-osrm.org updated? Just wanted to see it live… 😁 |
map.project-osrm.org is powered by OSRM-frontend. That repository will need to be updated, but first I have to publish a new version of OSRMTI. |
- Updated French localization with articles and prepositions insertion using grammar rules. #252 - Added a Burmese localization. #247 - Added a Finnish localization. #239 - Added a Korean localization. #243 - Updated translations in Simplified Chinese. #233 #248 - Updated Russian grammar with 'chord' status street name. #245 - Added Russian church names abbreviations. #237 - Corrected Lithuanian streets abbreviations. #238
- Updated French localization with articles and prepositions insertion using grammar rules. #252 - Added a Burmese localization. #247 - Added a Finnish localization. #239 - Added a Korean localization. #243 - Updated translations in Simplified Chinese. #233 #248 - Updated Russian grammar with 'chord' status street name. #245 - Added Russian church names abbreviations. #237 - Corrected Lithuanian streets abbreviations. #238
Issue
Initial French grammar rules prototype to insert articles to way names (#251).
Currently only
Rue
status street name is supported:Tasklist
Requirements / Relations
New
languages/overrides/fr.js
script addsarticle
option to mostway_name
keywords during translations export from Transifex,languages/grammar/fr.json
contains regular expressions (currently one) to process street names, changedlanguages.js
loads and registers that French expressions file.test/grammar_test.js
is extended with test for French.