@@ -110,7 +110,7 @@ npx jsr add @claudiu-ceia/ts-duckling
110110
111111### Extract entities
112112
113- Call ` Duckling() ` with no arguments to use ** all 18 built-in parsers** :
113+ Call ` Duckling() ` with no arguments to use ** all 19 built-in parsers** :
114114
115115``` ts
116116import { Duckling } from " @claudiu-ceia/ts-duckling" ;
@@ -362,33 +362,35 @@ const entities = Duckling([Email.parser, Hashtag.parser]).extract(
362362
363363## Supported entities
364364
365- | Entity | Kind | Example matches |
366- | --------------- | -------------- | - -------------------------------------------------------- |
367- | ** Time** | ` time ` | ` tomorrow at 3pm ` , ` next Friday ` , ` 2024-01-15T10:30:00Z ` |
368- | ** Range** | ` range ` | ` 2020-2024 ` , ` 20°C to 30°C ` , ` Monday to Friday ` |
369- | ** Temperature** | ` temperature ` | ` 72°F ` , ` 20 celsius ` , ` -5°C ` |
370- | ** Quantity** | ` quantity ` | ` 5 kg ` , ` 100 miles ` , ` 3,500.00 ` |
371- | ** Location** | ` location ` | ` United States ` , ` Germany ` , ` Japan ` |
372- | ** URL** | ` url ` | ` https://example.com/path?q=1 ` |
373- | ** Institution** | ` institution ` | ` University of Oxford ` , ` New York City Hall ` |
374- | ** Language** | ` language ` | ` English ` , ` Japanese ` , ` Portuguese ` |
365+ | Entity | Kind | Example matches |
366+ | --------------- | ------------- | -------------------------------------------------------- |
367+ | ** Time** | ` time ` | ` tomorrow at 3pm ` , ` next Friday ` , ` 2024-01-15T10:30:00Z ` |
368+ | ** Range** | ` range ` | ` 2020-2024 ` , ` 20°C to 30°C ` , ` Monday to Friday ` |
369+ | ** Temperature** | ` temperature ` | ` 72°F ` , ` 20 celsius ` , ` -5°C ` |
370+ | ** Quantity** | ` quantity ` | ` 5 kg ` , ` 100 miles ` , ` 3,500.00 ` |
371+ | ** Location** | ` location ` | ` United States ` , ` Germany ` , ` Japan ` |
372+ | ** URL** | ` url ` | ` https://example.com/path?q=1 ` |
373+ | ** Institution** | ` institution ` | ` University of Oxford ` , ` New York City Hall ` |
374+ | ** Language** | ` language ` | ` English ` , ` Japanese ` , ` Portuguese ` |
375375
376376### PII
377377
378- Available via ` PIIParsers ` for targeted redaction with ` Duckling(PIIParsers).redact(…) ` .
379-
380- | Entity | Kind | Example matches |
381- | --------------- | -------------- | --------------------------------------------------------- |
382- | ** Email** | ` email ` | ` user@example.com ` , ` first.last@company.io ` |
383- | ** Phone** | ` phone ` | ` +14155552671 ` , ` +44 20 7123 4567 ` , ` (415) 555-2671 ` |
384- | ** IP address** | ` ip ` | ` 192.168.1.1 ` , ` 2001:db8::1 ` , ` ::1 ` |
385- | ** SSN** | ` ssn ` | ` 123-45-6789 ` |
386- | ** Credit card** | ` credit_card ` | ` 4111 1111 1111 1111 ` , ` 5500-0000-0000-0004 ` |
387- | ** UUID** | ` uuid ` | ` 550e8400-e29b-41d4-a716-446655440000 ` |
388- | ** API key** | ` api_key ` | ` sk-proj-abc123… ` , ` ghp_abc123… ` , ` AKIA… ` |
389- | ** IBAN** | ` iban ` | ` GB29NWBK60161331926819 ` , ` DE89 3704 0044 0532 0130 00 ` |
390- | ** MAC address** | ` mac_address ` | ` 00:1A:2B:3C:4D:5E ` , ` 001A.2B3C.4D5E ` |
391- | ** JWT** | ` jwt ` | ` eyJhbGciOiJIUzI1NiIs… ` |
378+ Available via ` PIIParsers ` for targeted redaction with
379+ ` Duckling(PIIParsers).redact(…) ` .
380+
381+ | Entity | Kind | Example matches |
382+ | --------------- | ---------------- | ------------------------------------------------------- |
383+ | ** Email** | ` email ` | ` user@example.com ` , ` first.last@company.io ` |
384+ | ** Phone** | ` phone ` | ` +14155552671 ` , ` +44 20 7123 4567 ` , ` (415) 555-2671 ` |
385+ | ** IP address** | ` ip ` | ` 192.168.1.1 ` , ` 2001:db8::1 ` , ` ::1 ` |
386+ | ** SSN** | ` ssn ` | ` 123-45-6789 ` |
387+ | ** Credit card** | ` credit_card ` | ` 4111 1111 1111 1111 ` , ` 5500-0000-0000-0004 ` |
388+ | ** UUID** | ` uuid ` | ` 550e8400-e29b-41d4-a716-446655440000 ` |
389+ | ** API key** | ` api_key ` | ` sk-proj-abc123… ` , ` ghp_abc123… ` , ` AKIA… ` |
390+ | ** IBAN** | ` iban ` | ` GB29NWBK60161331926819 ` , ` DE89 3704 0044 0532 0130 00 ` |
391+ | ** MAC address** | ` mac_address ` | ` 00:1A:2B:3C:4D:5E ` , ` 001A.2B3C.4D5E ` |
392+ | ** JWT** | ` jwt ` | ` eyJhbGciOiJIUzI1NiIs… ` |
393+ | ** Crypto** | ` crypto_address ` | ` 0x742d35Cc…f2bD18 ` , ` bc1qar0srrr… ` , ` 1BvBMSEY… ` |
392394
393395## API reference
394396
@@ -415,7 +417,7 @@ function Duckling<T>(parsers: ParserTuple<T>): {
415417};
416418```
417419
418- Creates an extractor/renderer/redactor. Without arguments, uses all 18 built-in
420+ Creates an extractor/renderer/redactor. Without arguments, uses all 19 built-in
419421parsers and returns ` AnyEntity[] ` . When given an explicit parser array, the
420422return type narrows to the union of those entity types.
421423
@@ -520,6 +522,7 @@ const PIIParsers: [
520522 IBANParser ,
521523 MACAddressParser ,
522524 JWTParser ,
525+ CryptoAddressParser ,
523526];
524527```
525528
@@ -563,13 +566,13 @@ replace the span.
563566
564567### ` AnyEntity `
565568
566- Union of all 18 built-in entity types. This is the return element type of
569+ Union of all 19 built-in entity types. This is the return element type of
567570` Duckling().extract(...) ` .
568571
569572### ` PIIEntity `
570573
571- Union of the 10 PII entity types:
572- ` EmailEntity | PhoneEntity | IPAddressEntity | SSNEntity | CreditCardEntity | UUIDEntity | ApiKeyEntity | IBANEntity | MACAddressEntity | JWTEntity ` .
574+ Union of the 11 PII entity types:
575+ ` EmailEntity | PhoneEntity | IPAddressEntity | SSNEntity | CreditCardEntity | UUIDEntity | ApiKeyEntity | IBANEntity | MACAddressEntity | JWTEntity | CryptoAddressEntity ` .
573576
574577## Caveats
575578
0 commit comments