-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use cartesian product to generate combinations
- Loading branch information
Showing
9 changed files
with
96 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const preferredSaultSteMarieSpelling = "Sault Ste. Marie"; | ||
export declare const canadaPostSaultSteMarieSpelling = "S-STE-MARIE"; | ||
export declare const lowerCaseSaultSteMarieSpellings: Set<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import cartesianProduct from 'just-cartesian-product'; | ||
export const preferredSaultSteMarieSpelling = 'Sault Ste. Marie'; | ||
export const canadaPostSaultSteMarieSpelling = 'S-STE-MARIE'; | ||
const saultSpellings = [ | ||
'ault', | ||
'dault', | ||
's', | ||
'salt', | ||
'salut', | ||
'sault', | ||
'saulte', | ||
'soo', | ||
'sult' | ||
]; | ||
const steSpellings = ['s', 'st', 'ste', 'saint', 'sainte']; | ||
const marieSpellings = ['m', 'mare', 'marei', 'maire', 'marie', 'mary']; | ||
const lowerCaseSaultSteMarieSpellingsList = cartesianProduct([ | ||
saultSpellings, | ||
steSpellings, | ||
marieSpellings | ||
]).map((combination) => { | ||
return combination.join(' '); | ||
}); | ||
lowerCaseSaultSteMarieSpellingsList.push('sault stemarie', 'saultstemarie', 'ssm', 'ssmarie'); | ||
export const lowerCaseSaultSteMarieSpellings = new Set(lowerCaseSaultSteMarieSpellingsList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import cartesianProduct from 'just-cartesian-product' | ||
|
||
export const preferredSaultSteMarieSpelling = 'Sault Ste. Marie' | ||
|
||
export const canadaPostSaultSteMarieSpelling = 'S-STE-MARIE' | ||
|
||
const saultSpellings = [ | ||
'ault', | ||
'dault', | ||
's', | ||
'salt', | ||
'salut', | ||
'sault', | ||
'saulte', | ||
'soo', | ||
'sult' | ||
] | ||
|
||
const steSpellings = ['s', 'st', 'ste', 'saint', 'sainte'] | ||
|
||
const marieSpellings = ['m', 'mare', 'marei', 'maire', 'marie', 'mary'] | ||
|
||
const lowerCaseSaultSteMarieSpellingsList = cartesianProduct([ | ||
saultSpellings, | ||
steSpellings, | ||
marieSpellings | ||
]).map((combination) => { | ||
return combination.join(' ') | ||
}) | ||
|
||
lowerCaseSaultSteMarieSpellingsList.push( | ||
'sault stemarie', | ||
'saultstemarie', | ||
'ssm', | ||
'ssmarie' | ||
) | ||
|
||
export const lowerCaseSaultSteMarieSpellings = new Set( | ||
lowerCaseSaultSteMarieSpellingsList | ||
) |