Skip to content

Grammar notes update for Swift implementation#176

Merged
1ec5 merged 2 commits into
Project-OSRM:masterfrom
yuryleb:grammar-notes-update
Nov 3, 2017
Merged

Grammar notes update for Swift implementation#176
1ec5 merged 2 commits into
Project-OSRM:masterfrom
yuryleb:grammar-notes-update

Conversation

@yuryleb

@yuryleb yuryleb commented Oct 16, 2017

Copy link
Copy Markdown
Contributor

This PR updates Grammar feature description with notes about OSRM Text Instructions for Swift implementation specifics - always global matching regardless of specified regular expressions flags.

Some Russian regular expressions are also joint and optimized to work better in Swift too.

@yuryleb yuryleb force-pushed the grammar-notes-update branch 2 times, most recently from a0b7a76 to 05290ed Compare October 20, 2017 08:40
@mcwhittemore mcwhittemore requested a review from 1ec5 October 24, 2017 14:13
@mcwhittemore

Copy link
Copy Markdown
Contributor

@1ec5 can you take a look at this?

@yuryleb yuryleb force-pushed the grammar-notes-update branch 3 times, most recently from bdb7efa to f1a5114 Compare October 26, 2017 21:03
@yuryleb yuryleb force-pushed the grammar-notes-update branch from f1a5114 to 30816aa Compare October 31, 2017 20:26

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks alright to me on a technical level. @jcsg, could I interest you in reviewing the changes to the grammar rules?

Comment thread Grammar.md
- check `{way_name}` and `{rotary_name}` variables for optional grammar case after colon: `{way_name:accusative}`
- find appropriate regular expressions block for target language and specified grammar case
- call standard [string replace with regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) for each expression in block passing result from previous call to the next; the first call should enclose original street name with whitespaces to make parsing words in names a bit simplier.
- call standard [string replace with regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) for each expression in block passing result from previous call to the next; the first call should enclose original street name with whitespaces to make parsing several words inside name a bit simplier.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still a requirement, now that grammarize is called before capitalization and insertion (#170)?

@jcsg

jcsg commented Nov 3, 2017

Copy link
Copy Markdown

@1ec5 Yes, the changes to the grammar rules look good to me.

@1ec5 1ec5 merged commit d2709c4 into Project-OSRM:master Nov 3, 2017
@1ec5

1ec5 commented Nov 3, 2017

Copy link
Copy Markdown
Member

Thanks @yuryleb!

@yuryleb yuryleb deleted the grammar-notes-update branch November 3, 2017 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants