-
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.
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules/ | ||
.idea/ | ||
node_modules/ | ||
.DS_Store |
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,6 @@ | ||
.github/ | ||
.idea/ | ||
node_modules/ | ||
test/ | ||
.DS_Store | ||
.editorconfig |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Searches the specified last name for a preposition. | ||
* Optionally applies search options, if provided. | ||
* | ||
* @param lastName The last name to extract a preposition from. | ||
* @param options (Optional) The options to apply to the search. | ||
* @returns A FindPrepositionResult | ||
*/ | ||
export function findPreposition(lastName: String, options?: FindPrepositionOptions): FindPrepositionResult; | ||
|
||
export interface FindPrepositionOptions { | ||
/** | ||
* The array of prepositions to use. Uses the default bundled list if not specified. | ||
* When supplying your own list, make sure your prepositions end with a space when there | ||
* is a space between the preposition and the last name, otherwise the trailing space | ||
* would get included in the last name. | ||
* | ||
* Defaults to {@link DutchPrepositions}. | ||
*/ | ||
prepositions?: String[]; | ||
|
||
/** | ||
* An array of prepositions to exclude from the list. Useful if you want to exclude a specific preposition | ||
* from the default list. Keep in mind you'll need to end most prepositions with a trailing space. | ||
* | ||
* Defaults to an empty array. | ||
*/ | ||
exclude?: String[]; | ||
|
||
/** | ||
* Ignores a preposition if no other characters remain after matching it. | ||
* | ||
* Defaults to true. | ||
*/ | ||
ignoreIfNoSuffix?: Boolean; | ||
|
||
/** | ||
* Strips the trailing space from the preposition. | ||
* | ||
* Defaults to false. | ||
*/ | ||
stripTrailingSpace?: Boolean; | ||
} | ||
|
||
export interface FindPrepositionResult { | ||
/** | ||
* The found preposition, or null if nothing was found. | ||
*/ | ||
preposition: String | null; | ||
|
||
/** | ||
* The last name without the preposition, or null if the name would be an empty string. | ||
*/ | ||
lastName: String | null; | ||
} | ||
|
||
/** | ||
* A list of the most common Dutch prepositions, based on the Wikipedia article: https://nl.wikipedia.org/wiki/Tussenvoegsel | ||
*/ | ||
export const DutchPrepositions: String[]; |