Skip to content

Commit

Permalink
Update of inflector types and added TypeScript test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest committed Mar 26, 2024
1 parent d031b34 commit 1ce3d66
Show file tree
Hide file tree
Showing 5 changed files with 969 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/natural/distance/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
Copyright (c) 2022, Dylan R. E. Moonfire <https://github.com/dmoonfire>, Emily Marigold Klassen <https://github.com/forivall>, Hugo W.L. ter Doest
Copyright (c) 2023,
Dylan R. E. Moonfire <https://github.com/dmoonfire>,
Emily Marigold Klassen <https://github.com/forivall>,
Hugo W.L. ter Doest
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -20,8 +23,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

// Based on type definitions on Definitely Typed

declare interface JaroWinklerOptions {
dj?: number
/** @default false */
Expand Down
9 changes: 8 additions & 1 deletion lib/natural/inflectors/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

export class NounInflector {
export class SingularPluralInflector {
singularize (token: string): string
pluralize (token: string): string
addSingular (pattern: RegExp, replacement: string): void
addPlural (pattern: RegExp, replacement: string): void
}

export class NounInflector extends SingularPluralInflector {
pluralize (token: string): string
singularize (token: string): string
}
Expand Down
Loading

0 comments on commit 1ce3d66

Please sign in to comment.