Skip to content
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

feat(locale): add street_name to en_US, en_GB and en #2371

Merged
merged 10 commits into from
Oct 5, 2023

Conversation

xDivisionByZerox
Copy link
Member

@xDivisionByZerox xDivisionByZerox commented Sep 1, 2023

Description

This PR adds street_name locale data to the location definitions of the locales en, en_US and en_GB. The following table shows the sources I used for each locale:

Locale Name Source Link
en_US

https://en.wikipedia.org/wiki/Category:Streets_in_the_United_States_by_state

en_GB

https://en.wikipedia.org/wiki/Category:Streets_in_England

en Combination of en_GB and en_US

Links

This PR additionally fixes #2364.

@xDivisionByZerox xDivisionByZerox added c: feature Request for new feature p: 1-normal Nothing urgent c: locale Permutes locale definitions m: location Something is referring to the location module labels Sep 1, 2023
@xDivisionByZerox xDivisionByZerox requested a review from a team September 1, 2023 17:36
@xDivisionByZerox xDivisionByZerox self-assigned this Sep 1, 2023
@xDivisionByZerox xDivisionByZerox requested a review from a team as a code owner September 1, 2023 17:36
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #2371 (8555d8c) into next (5410239) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2371      +/-   ##
==========================================
- Coverage   99.58%   99.58%   -0.01%     
==========================================
  Files        2820     2823       +3     
  Lines      253975   255522    +1547     
  Branches     1103     1102       -1     
==========================================
+ Hits       252922   254462    +1540     
- Misses       1025     1032       +7     
  Partials       28       28              
Files Coverage Δ
src/locales/en/location/index.ts 100.00% <100.00%> (ø)
src/locales/en/location/street_name.ts 100.00% <100.00%> (ø)
src/locales/en/location/street_pattern.ts 100.00% <100.00%> (ø)
src/locales/en_GB/location/index.ts 100.00% <100.00%> (ø)
src/locales/en_GB/location/street_name.ts 100.00% <100.00%> (ø)
src/locales/en_GB/location/street_pattern.ts 100.00% <100.00%> (ø)
src/locales/en_US/location/index.ts 100.00% <100.00%> (ø)
src/locales/en_US/location/street_name.ts 100.00% <100.00%> (ø)
src/locales/en_US/location/street_pattern.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

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

If we are going to add these data, then they should appear in the street patterns as well.

@xDivisionByZerox
Copy link
Member Author

If we are going to add these data, then they should appear in the street patterns as well.

You mean by simply including a reference to {{location.street_name}}?


But then I would need to add street_suffix as well, wouldn't I? It would at least feel right for me. But then the PR would do to many things again.

@ST-DDT
Copy link
Member

ST-DDT commented Sep 1, 2023

But then I would need to add street_suffix as well, wouldn't I? It would at least feel right for me. But then the PR would do to many things again.

No, it should not include any suffixes. It should just add the street_names to the patterns.
The suffixes etc are only for street_name_part or first_names.

ST-DDT
ST-DDT previously approved these changes Sep 1, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Sep 1, 2023

So should we go this route?

@xDivisionByZerox xDivisionByZerox requested a review from a team September 1, 2023 21:37
@matthewmayer
Copy link
Contributor

I'm not convinced about using Wikipedia as a source. At least for en_GB these are often "famous" streets which are associated with a specific city (there are noticeably a lot of streets from London and Cambridge in the list)

It might be better to pick more generic names that frequently appear in en like Main Street, High Street.

src/locales/en_GB/location/street_name.ts Outdated Show resolved Hide resolved
src/locales/en_GB/location/street_name.ts Outdated Show resolved Hide resolved
src/locales/en_GB/location/street_name.ts Outdated Show resolved Hide resolved
@matthewmayer
Copy link
Contributor

Here is an alternative data source for en_GB, these are 400 common street names in UK - i used https://www.ordnancesurvey.co.uk/products/os-open-names#get to get a list of ~900,000 street names, found the most frequent, then handpicked 400.

export default [
    'Abbey Road',
    'Albany Road',
    'Albert Road',
    'Albion Street',
    'Alexandra Road',
    'Alfred Street',
    'Alma Street',
    'Ash Close',
    'Ash Grove',
    'Ash Road',
    'Aspen Close',
    'Avenue Road',
    'Back Lane',
    'Baker Street',
    'Balmoral Road',
    'Barn Close',
    'Barton Road',
    'Bath Road',
    'Bath Street',
    'Beach Road',
    'Bedford Road',
    'Beech Close',
    'Beech Drive',
    'Beech Grove',
    'Beech Road',
    'Beechwood Avenue',
    'Bell Lane',
    'Belmont Road',
    'Birch Avenue',
    'Birch Close',
    'Birch Grove',
    'Birch Road',
    'Blind Lane',
    'Bluebell Close',
    'Boundary Road',
    'Bramble Close',
    'Bramley Close',
    'Broad Lane',
    'Broad Street',
    'Broadway',
    'Brook Lane',
    'Brook Road',
    'Brook Street',
    'Brookside',
    'Buckingham Road',
    'Cambridge Street',
    'Castle Close',
    'Castle Lane',
    'Castle Road',
    'Castle Street',
    'Cavendish Road',
    'Cedar Avenue',
    'Cedar Close',
    'Cedar Grove',
    'Cedar Road',
    'Cemetery Road',
    'Central Avenue',
    'Chapel Close',
    'Chapel Hill',
    'Chapel Road',
    'Chapel Street',
    'Charles Street',
    'Cherry Close',
    'Cherry Tree Close',
    'Chester Road',
    'Chestnut Close',
    'Chestnut Drive',
    'Chestnut Grove',
    'Church Avenue',
    'Church Close',
    'Church Hill',
    'Church Lane',
    'Church Path',
    'Church Road',
    'Church View',
    'Church Walk',
    'Claremont Road',
    'Clarence Road',
    'Clarence Street',
    'Clarendon Road',
    'Clay Lane',
    'Cliff Road',
    'Clifton Road',
    'Commercial Road',
    'Commercial Street',
    'Common Lane',
    'Coronation Avenue',
    'Coronation Road',
    'Cow Lane',
    'Crescent Road',
    'Cromwell Road',
    'Cross Lane',
    'Cross Street',
    'Crown Street',
    'Dale Street',
    'Dark Lane',
    'Derby Road',
    'Derwent Close',
    'Devonshire Road',
    'Douglas Road',
    'Duke Street',
    'East Avenue',
    'East Road',
    'Edward Street',
    'Elm Close',
    'Elm Grove',
    'Elm Road',
    'Fairfield Road',
    'Farm Close',
    'Ferry Road',
    'Field Close',
    'Field Lane',
    'First Avenue',
    'Fore Street',
    'Forest Road',
    'Fourth Avenue',
    'Front Street',
    'Garden Close',
    'Garden Street',
    'George Street',
    'Gladstone Road',
    'Glebe Close',
    'Gloucester Road',
    'Gordon Road',
    'Gordon Street',
    'Grange Avenue',
    'Grange Close',
    'Grange Road',
    'Green Close',
    'Green Lane',
    'Green Street',
    'Greenway',
    'Grove Lane',
    'Grove Road',
    'Hall Lane',
    'Hall Street',
    'Hawthorn Avenue',
    'Hawthorn Close',
    'Hazel Close',
    'Hazel Grove',
    'Heath Road',
    'Heather Close',
    'Henry Street',
    'Heron Close',
    'High Road',
    'High Street',
    'Highfield Avenue',
    'Highfield Close',
    'Highfield Road',
    'Hill Road',
    'Hill Street',
    'Hillside Avenue',
    'Hillside Close',
    'Hillside Road',
    'Hillside',
    'Holly Close',
    'Honeysuckle Close',
    'Howard Road',
    'James Street',
    'Jubilee Close',
    'Juniper Close',
    'Kent Road',
    'Kestrel Close',
    'King Street',
    'King\'s Road',
    'Kingfisher Close',
    'Kingsway',
    'Laburnum Grove',
    'Lancaster Road',
    'Lansdowne Road',
    'Larch Close',
    'Laurel Close',
    'Lime Grove',
    'Lincoln Road',
    'Lodge Close',
    'Lodge Lane',
    'London Road',
    'Long Lane',
    'Low Road',
    'Main Road',
    'Main Street',
    'Manor Close',
    'Manor Drive',
    'Manor Gardens',
    'Manor Road',
    'Manor Way',
    'Maple Close',
    'Maple Drive',
    'Maple Road',
    'Market Place',
    'Market Square',
    'Marlborough Road',
    'Marsh Lane',
    'Mary Street',
    'Mayfield Road',
    'Meadow Close',
    'Meadow Drive',
    'Meadow Lane',
    'Meadow View',
    'Meadow Way',
    'Middle Street',
    'Mill Close',
    'Mill Lane',
    'Mill Road',
    'Mill Street',
    'Milton Road',
    'Milton Street',
    'Moor Lane',
    'Moss Lane',
    'Mount Pleasant',
    'Mount Street',
    'Nelson Road',
    'Nelson Street',
    'New Lane',
    'New Road',
    'New Street',
    'Newton Road',
    'Nightingale Close',
    'Norfolk Road',
    'North Avenue',
    'North Lane',
    'North Road',
    'Northfield Road',
    'Oak Avenue',
    'Oak Drive',
    'Oak Lane',
    'Oak Road',
    'Oak Street',
    'Oakfield Road',
    'Oaklands',
    'Old Lane',
    'Old Military Road',
    'Old Road',
    'Orchard Drive',
    'Orchard Lane',
    'Orchard Road',
    'Orchard Street',
    'Oxford Road',
    'Oxford Street',
    'Park Avenue',
    'Park Crescent',
    'Park Drive',
    'Park Lane',
    'Park Place',
    'Park Road',
    'Park Street',
    'Park View',
    'Parkside',
    'Pine Close',
    'Pine Grove',
    'Pinfold Lane',
    'Poplar Avenue',
    'Poplar Close',
    'Poplar Road',
    'Pound Lane',
    'Princes Street',
    'Princess Street',
    'Priory Close',
    'Priory Road',
    'Prospect Place',
    'Prospect Road',
    'Quarry Lane',
    'Quarry Road',
    'Queen\'s Road',
    'Railway Street',
    'Rectory Close',
    'Rectory Lane',
    'Richmond Close',
    'Richmond Road',
    'Riverside',
    'Roman Road',
    'Roman Way',
    'Rowan Close',
    'Russell Street',
    'Salisbury Road',
    'Sandringham Road',
    'Sandy Lane',
    'School Close',
    'School Lane',
    'School Road',
    'Second Avenue',
    'Silver Street',
    'Smith Street',
    'Somerset Road',
    'South Drive',
    'South Road',
    'South Street',
    'South View',
    'Spring Gardens',
    'Springfield Close',
    'Springfield Road',
    'St Andrew\'s Road',
    'St Andrews Close',
    'St George\'s Road',
    'St John\'s Road',
    'St Mary\'s Close',
    'St Mary\'s Road',
    'Stanley Road',
    'Stanley Street',
    'Station Road',
    'Station Street',
    'Stoney Lane',
    'Sycamore Avenue',
    'Sycamore Close',
    'Sycamore Drive',
    'Talbot Road',
    'Tennyson Road',
    'The Avenue',
    'The Beeches',
    'The Causeway',
    'The Chase',
    'The Coppice',
    'The Copse',
    'The Crescent',
    'The Croft',
    'The Dell',
    'The Drive',
    'The Fairway',
    'The Glebe',
    'The Grange',
    'The Green',
    'The Grove',
    'The Hawthorns',
    'The Lane',
    'The Laurels',
    'The Limes',
    'The Maltings',
    'The Meadows',
    'The Mews',
    'The Mount',
    'The Oaks',
    'The Orchard',
    'The Oval',
    'The Paddock',
    'The Paddocks',
    'The Poplars',
    'The Ridgeway',
    'The Ridings',
    'The Rise',
    'The Sidings',
    'The Spinney',
    'The Square',
    'The Willows',
    'The Woodlands',
    'Third Avenue',
    'Tower Road',
    'Trinity Road',
    'Tudor Close',
    'Union Street',
    'Valley Road',
    'Vicarage Close',
    'Vicarage Lane',
    'Vicarage Road',
    'Victoria Place',
    'Victoria Road',
    'Victoria Street',
    'Walnut Close',
    'Warren Close',
    'Warren Road',
    'Water Lane',
    'Water Street',
    'Waterloo Road',
    'Waterside',
    'Watery Lane',
    'Waverley Road',
    'Well Lane',
    'Wellington Road',
    'Wellington Street',
    'West End',
    'West Lane',
    'West Street',
    'West View',
    'Western Avenue',
    'Western Road',
    'Westfield Road',
    'Westgate',
    'William Street',
    'Willow Close',
    'Willow Drive',
    'Willow Grove',
    'Willow Road',
    'Windermere Road',
    'Windmill Close',
    'Windmill Lane',
    'Windsor Avenue',
    'Windsor Close',
    'Windsor Drive',
    'Wood Lane',
    'Wood Street',
    'Woodland Close',
    'Woodland Road',
    'Woodlands Avenue',
    'Woodlands Close',
    'Woodlands Road',
    'Woodlands',
    'Woodside Road',
    'Woodside',
    'Wren Close',
    'Yew Tree Close',
    'York Road',
    'York Street',
];

@xDivisionByZerox
Copy link
Member Author

xDivisionByZerox commented Sep 2, 2023

Pardon me @matthewmayer but what exactly is your problem? street_namerepresent street names which exist in the real world. There is no further requirements specified which the data set needs to comply to. I don't see why I should do any work if you decard it anyway by doing the work yourself. At least give me a chance to fix the problem instead of you doing it all. This kind of bugs me.

Nevertheless, I still appreciate your feedback an can change the according files.

@matthewmayer
Copy link
Contributor

Faker is often used for things like populating mockups. Therefore it's good to avoid fake data that stands out too much . So for example we use common surnames like Smith not celebrity names like "Arnold Schwarzenegger"

Similarly I think we should avoid "weird" street names, ones that exist only in a single place, contain profanity, etc.

@matthewmayer
Copy link
Contributor

Apologies if you felt I was stepping on your toes by proposing an alternative source of data. That was not my intention. The PR is good I just think the Wikipedia category is not a great source due to the reasons I list above.

Feel free to modify the original data or merge in some of my suggestions as you prefer.

@xDivisionByZerox
Copy link
Member Author

Apologies if you felt I was stepping on your toes by proposing an alternative source of data. That was not my intention. The PR is good I just think the Wikipedia category is not a great source due to the reasons I list above.

Feel free to modify the original data or merge in some of my suggestions as you prefer.

No hard feelings. Just wanted to get this off my chest. My primary concern was the limited time I had to respond, especially considering that this project is OSS and not a commercial product. Again, your suggestions and alternative data sources were quite helpful so thank you for that.

@matthewmayer
Copy link
Contributor

Using a similar methodology and the US TIGER Shapefiles for all states of the US, here are just under 400 popular en_US street names

export default ['10th Street',
'11th Street',
'12th Street',
'13th Street',
'14th Street',
'15th Street',
'16th Street',
'1st Avenue',
'1st Street',
'2nd Avenue',
'2nd Street',
'3rd Avenue',
'3rd Street',
'4th Avenue',
'4th Street',
'5th Avenue',
'5th Street',
'6th Avenue',
'6th Street',
'7th Avenue',
'7th Street',
'8th Avenue',
'8th Street',
'9th Street',
'A Street',
'Adams Avenue',
'Adams Street',
'Airport Road',
'Ash Street',
'Atlantic Avenue',
'Bay Street',
'Bridge Road',
'Bridge Street',
'Broad Street',
'Broadway',
'Broadway Avenue',
'Broadway Street',
'Canal Street',
'Cedar Street',
'Cemetery Road',
'Center Avenue',
'Center Road',
'Center Street',
'Central Avenue',
'Central Street',
'Charles Street',
'Cherry Street',
'Chestnut Street',
'Church Street',
'Clark Street',
'Cleveland Street',
'Clinton Street',
'College Avenue',
'College Street',
'Columbia Avenue',
'Commerce Street',
'Commercial Street',
'County Line Road',
'County Road',
'Court Street',
'Cross Street',
'Cumberland Street',
'Davis Street',
'Depot Street',
'Division Street',
'E 10th Street',
'E 11th Street',
'E 12th Street',
'E 14th Street',
'E 1st Street',
'E 2nd Street',
'E 3rd Street',
'E 4th Avenue',
'E 4th Street',
'E 5th Street',
'E 6th Avenue',
'E 6th Street',
'E 7th Street',
'E 8th Street',
'E 9th Street',
'E Bridge Street',
'E Broad Street',
'E Broadway',
'E Broadway Street',
'E Cedar Street',
'E Center Street',
'E Central Avenue',
'E Church Street',
'E Elm Street',
'E Franklin Street',
'E Front Street',
'E Grand Avenue',
'E High Street',
'E Jackson Street',
'E Jefferson Street',
'E Main',
'E Main Street',
'E Maple Street',
'E Market Street',
'E North Street',
'E Oak Street',
'E Park Avenue',
'E Pine Street',
'E River Road',
'E South Street',
'E State Street',
'E Union Street',
'E Walnut Street',
'E Washington Avenue',
'E Washington Street',
'E Water Street',
'East Avenue',
'East Street',
'Elm Street',
'Euclid Avenue',
'Ferry Road',
'First Street',
'Forest Avenue',
'Franklin Avenue',
'Franklin Road',
'Franklin Street',
'Front Street',
'Frontage Road',
'Grand Avenue',
'Grant Street',
'Green Street',
'Greenville Road',
'Greenwood Road',
'Grove Street',
'Harrison Avenue',
'Harrison Street',
'Hickory Street',
'High Street',
'Highland Avenue',
'Hill Street',
'Howard Street',
'Jackson Avenue',
'Jackson Street',
'Jefferson Avenue',
'Jefferson Street',
'Johnson Street',
'King Street',
'Kings Highway',
'Lafayette Street',
'Lake Avenue',
'Lake Drive',
'Lake Road',
'Lake Street',
'Lawrence Street',
'Lee Street',
'Liberty Street',
'Lincoln Avenue',
'Lincoln Highway',
'Lincoln Road',
'Lincoln Street',
'Locust Street',
'Madison Avenue',
'Madison Street',
'Main',
'Main Avenue',
'Main Road',
'Main Street',
'Main Street E',
'Main Street N',
'Main Street S',
'Main Street W',
'Manchester Road',
'Maple Avenue',
'Maple Street',
'Market Street',
'Martin Luther King Boulevard',
'Martin Luther King Drive',
'Martin Luther King Jr Boulevard',
'Memorial Drive',
'Middle Street',
'Mill Road',
'Mill Street',
'Monroe Street',
'Mulberry Street',
'N 1st Street',
'N 2nd Street',
'N 3rd Street',
'N 4th Street',
'N 5th Street',
'N 6th Street',
'N 7th Street',
'N 8th Street',
'N 9th Street',
'N Bridge Street',
'N Broad Street',
'N Broadway',
'N Broadway Street',
'N Cedar Street',
'N Center Street',
'N Central Avenue',
'N Chestnut Street',
'N Church Street',
'N College Street',
'N Court Street',
'N Division Street',
'N East Street',
'N Elm Street',
'N Franklin Street',
'N Front Street',
'N Harrison Street',
'N High Street',
'N Jackson Street',
'N Jefferson Street',
'N Lincoln Street',
'N Locust Street',
'N Main',
'N Main Avenue',
'N Main Street',
'N Maple Street',
'N Market Street',
'N Monroe Street',
'N Oak Street',
'N Park Street',
'N Pearl Street',
'N Pine Street',
'N Poplar Street',
'N Railroad Street',
'N State Street',
'N Union Street',
'N Walnut Street',
'N Washington Avenue',
'N Washington Street',
'N Water Street',
'North Avenue',
'North Road',
'North Street',
'Oak Avenue',
'Oak Street',
'Old State Road',
'Park Avenue',
'Park Drive',
'Park Street',
'Pearl Street',
'Pennsylvania Avenue',
'Pine Street',
'Pleasant Street',
'Poplar Street',
'Post Road',
'Prospect Avenue',
'Prospect Street',
'Railroad Avenue',
'Railroad Street',
'Ridge Road',
'River Road',
'River Street',
'Riverside Avenue',
'Riverside Drive',
'S 10th Street',
'S 14th Street',
'S 1st Avenue',
'S 1st Street',
'S 2nd Street',
'S 3rd Street',
'S 4th Street',
'S 5th Street',
'S 6th Street',
'S 7th Street',
'S 8th Street',
'S 9th Street',
'S Bridge Street',
'S Broad Street',
'S Broadway',
'S Broadway Street',
'S Center Street',
'S Central Avenue',
'S Chestnut Street',
'S Church Street',
'S College Street',
'S Division Street',
'S East Street',
'S Elm Street',
'S Franklin Street',
'S Front Street',
'S Grand Avenue',
'S High Street',
'S Jackson Street',
'S Jefferson Street',
'S Lincoln Street',
'S Main',
'S Main Avenue',
'S Main Street',
'S Maple Street',
'S Market Street',
'S Mill Street',
'S Monroe Street',
'S Oak Street',
'S Park Street',
'S Pine Street',
'S Railroad Street',
'S State Street',
'S Union Street',
'S Walnut Street',
'S Washington Avenue',
'S Washington Street',
'S Water Street',
'S West Street',
'School Street',
'Skyline Drive',
'South Avenue',
'South Street',
'Spring Street',
'Springfield Road',
'Spruce Street',
'State Avenue',
'State Line Road',
'State Road',
'State Street',
'Sycamore Street',
'Third Street',
'Union Avenue',
'Union Street',
'University Avenue',
'University Drive',
'Valley Road',
'Veterans Memorial Drive',
'Veterans Memorial Highway',
'Vine Street',
'W 10th Street',
'W 11th Street',
'W 12th Street',
'W 14th Street',
'W 1st Street',
'W 2nd Street',
'W 3rd Street',
'W 4th Avenue',
'W 4th Street',
'W 5th Street',
'W 6th Avenue',
'W 6th Street',
'W 7th Street',
'W 8th Street',
'W 9th Street',
'W Bridge Street',
'W Broad Street',
'W Broadway',
'W Broadway Avenue',
'W Broadway Street',
'W Center Street',
'W Central Avenue',
'W Chestnut Street',
'W Church Street',
'W Division Street',
'W Elm Street',
'W Franklin Street',
'W Front Street',
'W Grand Avenue',
'W High Street',
'W Jackson Street',
'W Jefferson Street',
'W Lake Street',
'W Main',
'W Main Street',
'W Maple Street',
'W Market Street',
'W Monroe Street',
'W North Street',
'W Oak Street',
'W Park Street',
'W Pine Street',
'W River Road',
'W South Street',
'W State Street',
'W Union Street',
'W Walnut Street',
'W Washington Avenue',
'W Washington Street',
'Walnut Street',
'Washington Avenue',
'Washington Boulevard',
'Washington Road',
'Washington Street',
'Water Street',
'West Avenue',
'West Road',
'West Street',
'Western Avenue',
'Willow Street',
]

@Shinigami92
Copy link
Member

My approval given, when @matthewmayer's things got addressed 🙂

@ST-DDT ST-DDT added the needs rebase There is a merge conflict label Sep 10, 2023
@xDivisionByZerox
Copy link
Member Author

Thanks for reminding me that I have a doing here. I can get it done this afternoon.

@xDivisionByZerox xDivisionByZerox removed the needs rebase There is a merge conflict label Sep 10, 2023
@ST-DDT ST-DDT enabled auto-merge (squash) October 5, 2023 17:49
@ST-DDT ST-DDT merged commit 491d319 into next Oct 5, 2023
20 checks passed
@ST-DDT ST-DDT deleted the feat/locale/add-street-name-to-en branch October 5, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature c: locale Permutes locale definitions m: location Something is referring to the location module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a new locale without street_name definitions causes test failure
5 participants