pelias / parser

natural language classification engine for geocoding
https://parser.demo.geocode.earth
MIT License
55 stars 27 forks source link

NumericStreet: New classification for streets starting with a number #175

Open JanF01 opened 1 year ago

JanF01 commented 1 year ago

Use-cases

Hi, I have found that there are many streets in Poland that begin with a NumericClassifier. To name some: 1 Maja , 3 Maja, 11 Listopada, 29 listopada , 1 Pułku.

Specificaly I'm having those problems when sending autocomplete requests:

/autocomplete?focus=50.089106, 19.957787&text=11 listopada 2/4&layer=address results:

"places": []

If the streets were to be properly recognized and the housenumber separated:

"places": [
        {
            "gid": "openaddresses:address:pl/mazowieckie:261ea02d958e2be8",
            "label": "11 Listopada 2/4, Radom, MZ, Polska",
            ...

Attempted Solutions

I have added a classification scheme for cases like aleja 29 Listopada aleja 11 listopada

{
    // Aleja 11 Listopada 
    confidence: 0.84,
    Class: StreetClassification,
    scheme: [
      {
        is: ['StreetPrefixClassification'],
        not: ['StreetClassification', 'IntersectionClassification']
      },
      {
        is: ['NumericClassification'],
        not: ['StreetClassification', 'IntersectionClassification']
      },
      {
        is: ['AlphaClassification', 'GivenNameClassification', 'PersonClassification'],
        not: ['StreetClassification', 'StreetPrefixClassification']
      }
    ]
 }

This classification works with all tests passed. On the other hand ( which is understandable ), such classification fails on multiple tests:

{
    // 11 Listopada 
    confidence: 0.84,
    Class: StreetClassification,
    scheme: [
      {
        is: ['NumericClassification'],
        not: ['StreetClassification', 'IntersectionClassification']
      },
      {
        is: ['AlphaClassification', 'GivenNameClassification', 'PersonClassification'],
        not: ['StreetClassification', 'StreetPrefixClassification']
      }
    ]
 }

Proposal

My proposal would be to create a new Classification, specificaly with words that could appear after a NumericClassification and create a street name altogether instead of beeing a separate entity.