@doccloak/core 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.md +230 -0
  5. package/dist/doc.d.ts +13 -0
  6. package/dist/doc.js +683 -0
  7. package/dist/docx.d.ts +31 -0
  8. package/dist/docx.js +26 -0
  9. package/dist/dom/docx.d.ts +90 -0
  10. package/dist/dom/docx.js +472 -0
  11. package/dist/dom/index.d.ts +11 -0
  12. package/dist/dom/index.js +11 -0
  13. package/dist/dom/ocr.d.ts +112 -0
  14. package/dist/dom/ocr.js +224 -0
  15. package/dist/engine.d.ts +81 -0
  16. package/dist/engine.js +274 -0
  17. package/dist/env.d.ts +49 -0
  18. package/dist/env.js +53 -0
  19. package/dist/index.d.ts +20 -0
  20. package/dist/index.js +29 -0
  21. package/dist/model-loader.d.ts +55 -0
  22. package/dist/model-loader.js +253 -0
  23. package/dist/pipeline.d.ts +19 -0
  24. package/dist/pipeline.js +128 -0
  25. package/dist/providers/bardsai.d.ts +38 -0
  26. package/dist/providers/bardsai.js +393 -0
  27. package/dist/providers/gliner.d.ts +52 -0
  28. package/dist/providers/gliner.js +360 -0
  29. package/dist/regex/index.d.ts +17 -0
  30. package/dist/regex/index.js +18 -0
  31. package/dist/regex/loader.d.ts +44 -0
  32. package/dist/regex/loader.js +44 -0
  33. package/dist/regex/rules.data.d.ts +2 -0
  34. package/dist/regex/rules.data.js +2671 -0
  35. package/dist/regex/types.d.ts +27 -0
  36. package/dist/regex/types.js +1 -0
  37. package/dist/regex/validators.d.ts +17 -0
  38. package/dist/regex/validators.js +492 -0
  39. package/dist/session.d.ts +59 -0
  40. package/dist/session.js +153 -0
  41. package/dist/types.d.ts +42 -0
  42. package/dist/types.js +28 -0
  43. package/dist/worker-protocol.d.ts +119 -0
  44. package/dist/worker-protocol.js +285 -0
  45. package/package.json +75 -0
  46. package/rules/at.json +70 -0
  47. package/rules/be.json +70 -0
  48. package/rules/ch.json +66 -0
  49. package/rules/cn.json +155 -0
  50. package/rules/de.json +192 -0
  51. package/rules/dk.json +43 -0
  52. package/rules/es.json +158 -0
  53. package/rules/fi.json +43 -0
  54. package/rules/fr.json +178 -0
  55. package/rules/gb.json +194 -0
  56. package/rules/ie.json +48 -0
  57. package/rules/it.json +116 -0
  58. package/rules/jp.json +136 -0
  59. package/rules/nl.json +99 -0
  60. package/rules/no.json +132 -0
  61. package/rules/pl.json +210 -0
  62. package/rules/pt.json +113 -0
  63. package/rules/schema.json +91 -0
  64. package/rules/se.json +149 -0
  65. package/rules/universal.json +279 -0
  66. package/rules/us.json +218 -0
package/rules/it.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "region": "it",
3
+ "rules": [
4
+ {
5
+ "id": "regex:it:codice_fiscale",
6
+ "entityType": "SSN",
7
+ "pattern": "\\b[A-Z]{6}\\d{2}[A-EHLMPRST]\\d{2}[A-Z]\\d{3}[A-Z]\\b",
8
+ "flags": "gi",
9
+ "confidence": 0.9,
10
+ "domains": [
11
+ "identity",
12
+ "hr",
13
+ "medical"
14
+ ],
15
+ "description": "Italian fiscal code (Codice Fiscale, 16 alphanumeric characters)",
16
+ "examples": [
17
+ "RSSMRA85M01H501Q"
18
+ ],
19
+ "validate": "codiceFiscale"
20
+ },
21
+ {
22
+ "id": "regex:it:partita_iva",
23
+ "entityType": "SSN",
24
+ "pattern": "\\bIT\\d{11}\\b",
25
+ "flags": "gi",
26
+ "confidence": 0.75,
27
+ "domains": [
28
+ "financial",
29
+ "legal"
30
+ ],
31
+ "description": "Italian VAT number (Partita IVA, IT + 11 digits)",
32
+ "examples": [
33
+ "IT12345678903"
34
+ ],
35
+ "validate": "partitaIva"
36
+ },
37
+ {
38
+ "id": "regex:it:phone_mobile",
39
+ "entityType": "PHONE",
40
+ "pattern": "\\b(?:\\+?39[\\s-]?)?3[0-9]{2}[\\s-]?\\d{3}[\\s-]?\\d{4}\\b",
41
+ "flags": "g",
42
+ "confidence": 0.8,
43
+ "domains": [
44
+ "contact"
45
+ ],
46
+ "description": "Italian mobile phone number (3xx prefix)",
47
+ "examples": [
48
+ "+39 345 123 4567",
49
+ "3451234567"
50
+ ]
51
+ },
52
+ {
53
+ "id": "regex:it:phone_landline",
54
+ "entityType": "PHONE",
55
+ "pattern": "\\b(?:\\+?39[\\s-]?)?0\\d{1,3}[\\s-]?\\d{4,8}\\b",
56
+ "flags": "g",
57
+ "confidence": 0.7,
58
+ "domains": [
59
+ "contact"
60
+ ],
61
+ "description": "Italian landline phone number (0x prefix)",
62
+ "examples": [
63
+ "+39 06 12345678",
64
+ "02 12345678"
65
+ ]
66
+ },
67
+ {
68
+ "id": "regex:it:street",
69
+ "entityType": "ADDRESS",
70
+ "pattern": "(?:via|viale|v\\.le|piazza|p\\.zza|piazzale|corso|c\\.so|largo|vicolo|borgo|salita)\\s+[\\p{L}][\\p{L}\\s'.,-]+\\s*(?:,?\\s*n[°.]?\\s*)?\\d{1,5}[\\p{L}]?",
71
+ "flags": "giu",
72
+ "confidence": 0.9,
73
+ "domains": [
74
+ "contact"
75
+ ],
76
+ "description": "Italian street address (Via/Piazza/Corso + name + number)",
77
+ "examples": [
78
+ "Via Roma, 42",
79
+ "Piazza Navona 1",
80
+ "Corso Vittorio Emanuele II, n. 23"
81
+ ]
82
+ },
83
+ {
84
+ "id": "regex:it:postal",
85
+ "entityType": "ADDRESS",
86
+ "pattern": "\\b\\d{5}\\s+[\\p{L}][\\p{L}\\s-]+\\b",
87
+ "flags": "gu",
88
+ "confidence": 0.8,
89
+ "domains": [
90
+ "contact"
91
+ ],
92
+ "description": "Italian postal code (CAP, 5 digits) followed by city name",
93
+ "examples": [
94
+ "00100 Roma",
95
+ "20121 Milano"
96
+ ],
97
+ "falsePositiveNotes": "5-digit postal codes overlap with US ZIP codes and other number formats"
98
+ },
99
+ {
100
+ "id": "regex:it:company",
101
+ "entityType": "COMPANY",
102
+ "pattern": "[\\p{L}][\\p{L}\\s&.']+(?:\\s+)?(?:S\\.?r\\.?l\\.?|S\\.?p\\.?A\\.?|S\\.?a\\.?s\\.?|S\\.?n\\.?c\\.?|S\\.?a\\.?p\\.?a\\.?)\\b",
103
+ "flags": "gu",
104
+ "confidence": 0.9,
105
+ "domains": [
106
+ "legal",
107
+ "financial"
108
+ ],
109
+ "description": "Italian company name with legal form (S.r.l., S.p.A., S.a.s., S.n.c., S.a.p.a.)",
110
+ "examples": [
111
+ "Fiat Chrysler S.p.A.",
112
+ "Ristorante Da Mario S.r.l."
113
+ ]
114
+ }
115
+ ]
116
+ }
package/rules/jp.json ADDED
@@ -0,0 +1,136 @@
1
+ {
2
+ "region": "jp",
3
+ "rules": [
4
+ {
5
+ "id": "regex:jp:my_number",
6
+ "entityType": "SSN",
7
+ "pattern": "\\b\\d{4}\\s?\\d{4}\\s?\\d{4}\\b",
8
+ "flags": "g",
9
+ "confidence": 0.7,
10
+ "domains": [
11
+ "identity"
12
+ ],
13
+ "description": "Japanese My Number (individual number, 12 digits)",
14
+ "examples": [
15
+ "1234 5678 9012"
16
+ ]
17
+ },
18
+ {
19
+ "id": "regex:jp:passport",
20
+ "entityType": "SSN",
21
+ "pattern": "\\b[A-Z]{2}\\d{7}\\b",
22
+ "flags": "g",
23
+ "confidence": 0.7,
24
+ "domains": [
25
+ "identity"
26
+ ],
27
+ "description": "Japanese passport number (2 letters + 7 digits)",
28
+ "examples": [
29
+ "TK1234567"
30
+ ]
31
+ },
32
+ {
33
+ "id": "regex:jp:corporate_number",
34
+ "entityType": "SSN",
35
+ "pattern": "\\b\\d{13}\\b",
36
+ "flags": "g",
37
+ "confidence": 0.5,
38
+ "domains": [
39
+ "identity",
40
+ "financial"
41
+ ],
42
+ "description": "Japanese corporate number (houjin bangou, 13 digits)",
43
+ "examples": [
44
+ "1234567890123"
45
+ ]
46
+ },
47
+ {
48
+ "id": "regex:jp:phone",
49
+ "entityType": "PHONE",
50
+ "pattern": "\\b0\\d{1,4}[\\s-]?\\d{1,4}[\\s-]?\\d{3,4}\\b",
51
+ "flags": "g",
52
+ "confidence": 0.8,
53
+ "domains": [
54
+ "contact"
55
+ ],
56
+ "description": "Japanese phone number (0X-XXXX-XXXX, variable area code length)",
57
+ "examples": [
58
+ "03-1234-5678",
59
+ "090-1234-5678",
60
+ "0120-123-456"
61
+ ]
62
+ },
63
+ {
64
+ "id": "regex:jp:postal",
65
+ "entityType": "ADDRESS",
66
+ "pattern": "\\b\\d{3}-?\\d{4}\\b",
67
+ "flags": "g",
68
+ "confidence": 0.65,
69
+ "domains": [
70
+ "contact"
71
+ ],
72
+ "description": "Japanese postal code (XXX-XXXX)",
73
+ "examples": [
74
+ "100-0001",
75
+ "1600023"
76
+ ]
77
+ },
78
+ {
79
+ "id": "regex:jp:currency_kanji",
80
+ "entityType": "CURRENCY",
81
+ "pattern": "[一二三四五六七八九十百千万億兆]+\\s*円",
82
+ "flags": "g",
83
+ "confidence": 0.9,
84
+ "domains": [
85
+ "financial"
86
+ ],
87
+ "description": "Japanese amount in kanji numerals + yen sign (e.g., 八千五百円)",
88
+ "examples": [
89
+ "八千五百円"
90
+ ]
91
+ },
92
+ {
93
+ "id": "regex:jp:address",
94
+ "entityType": "ADDRESS",
95
+ "pattern": "[\\u4E00-\\u9FFF]+[都道府県][\\u4E00-\\u9FFF]+[市区町村郡][\\u4E00-\\u9FFF\\d-]+",
96
+ "flags": "g",
97
+ "confidence": 0.85,
98
+ "domains": [
99
+ "contact"
100
+ ],
101
+ "description": "Japanese address (prefecture + city/ward + district)",
102
+ "examples": [
103
+ "東京都千代田区丸の内1-1-1"
104
+ ]
105
+ },
106
+ {
107
+ "id": "regex:jp:company_prefix",
108
+ "entityType": "COMPANY",
109
+ "pattern": "(?:株式会社|有限会社|合同会社|合名会社|合資会社)\\s*[\\u4E00-\\u9FFF\\p{L}\\s]+",
110
+ "flags": "gu",
111
+ "confidence": 0.9,
112
+ "domains": [
113
+ "general"
114
+ ],
115
+ "description": "Japanese company with legal prefix (kabushiki gaisha etc.)",
116
+ "examples": [
117
+ "株式会社トヨタ自動車",
118
+ "有限会社田中商店"
119
+ ]
120
+ },
121
+ {
122
+ "id": "regex:jp:company_suffix",
123
+ "entityType": "COMPANY",
124
+ "pattern": "[\\u4E00-\\u9FFF\\p{L}][\\u4E00-\\u9FFF\\p{L}\\s]+(?:株式会社|有限会社|合同会社)",
125
+ "flags": "gu",
126
+ "confidence": 0.9,
127
+ "domains": [
128
+ "general"
129
+ ],
130
+ "description": "Japanese company with legal suffix (name + kabushiki gaisha)",
131
+ "examples": [
132
+ "トヨタ自動車株式会社"
133
+ ]
134
+ }
135
+ ]
136
+ }
package/rules/nl.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "region": "nl",
3
+ "rules": [
4
+ {
5
+ "id": "regex:nl:bsn",
6
+ "entityType": "SSN",
7
+ "pattern": "\\b\\d{9}\\b",
8
+ "flags": "g",
9
+ "confidence": 0.85,
10
+ "domains": [
11
+ "identity",
12
+ "hr"
13
+ ],
14
+ "description": "Dutch citizen service number (BSN, 9 digits with elfproef validation)",
15
+ "examples": [
16
+ "123456782"
17
+ ],
18
+ "falsePositiveNotes": "9 bare digits match many formats; elfproef validation essential",
19
+ "validate": "bsn"
20
+ },
21
+ {
22
+ "id": "regex:nl:phone_mobile",
23
+ "entityType": "PHONE",
24
+ "pattern": "\\b(?:\\+?31[\\s-]?|0)6[\\s-]?\\d{4}[\\s-]?\\d{4}\\b",
25
+ "flags": "g",
26
+ "confidence": 0.85,
27
+ "domains": [
28
+ "contact"
29
+ ],
30
+ "description": "Dutch mobile phone number (06 prefix)",
31
+ "examples": [
32
+ "+31 6 1234 5678",
33
+ "06 12345678"
34
+ ]
35
+ },
36
+ {
37
+ "id": "regex:nl:phone_landline",
38
+ "entityType": "PHONE",
39
+ "pattern": "\\b(?:\\+?31[\\s-]?|0)[1-5]\\d[\\s-]?\\d{3}[\\s-]?\\d{4}\\b",
40
+ "flags": "g",
41
+ "confidence": 0.75,
42
+ "domains": [
43
+ "contact"
44
+ ],
45
+ "description": "Dutch landline phone number (area code prefix)",
46
+ "examples": [
47
+ "+31 20 123 4567",
48
+ "020 1234567"
49
+ ]
50
+ },
51
+ {
52
+ "id": "regex:nl:postal",
53
+ "entityType": "ADDRESS",
54
+ "pattern": "\\b\\d{4}\\s?[A-Z]{2}\\b",
55
+ "flags": "g",
56
+ "confidence": 0.8,
57
+ "domains": [
58
+ "contact"
59
+ ],
60
+ "description": "Dutch postal code (4 digits + 2 letters)",
61
+ "examples": [
62
+ "1012 AB",
63
+ "3511XA"
64
+ ]
65
+ },
66
+ {
67
+ "id": "regex:nl:street",
68
+ "entityType": "ADDRESS",
69
+ "pattern": "[\\p{L}][\\p{L}\\s'-]*(?:straat|weg|laan|plein|gracht|kade|singel|dijk|steeg|dreef|hof|markt)\\s+\\d{1,5}[\\p{L}]?",
70
+ "flags": "giu",
71
+ "confidence": 0.85,
72
+ "domains": [
73
+ "contact"
74
+ ],
75
+ "description": "Dutch street address (name + straat/weg/laan/gracht + number)",
76
+ "examples": [
77
+ "Keizersgracht 123",
78
+ "Dorpsstraat 45a",
79
+ "Marktplein 7"
80
+ ]
81
+ },
82
+ {
83
+ "id": "regex:nl:company",
84
+ "entityType": "COMPANY",
85
+ "pattern": "[\\p{L}][\\p{L}\\s&.']+(?:\\s+)?(?:B\\.?V\\.?|N\\.?V\\.?|V\\.?O\\.?F\\.?|C\\.?V\\.?)\\b",
86
+ "flags": "gu",
87
+ "confidence": 0.9,
88
+ "domains": [
89
+ "legal",
90
+ "financial"
91
+ ],
92
+ "description": "Dutch company name with legal form (B.V., N.V., V.O.F., C.V.)",
93
+ "examples": [
94
+ "Philips N.V.",
95
+ "Shell Nederland B.V."
96
+ ]
97
+ }
98
+ ]
99
+ }
package/rules/no.json ADDED
@@ -0,0 +1,132 @@
1
+ {
2
+ "region": "no",
3
+ "rules": [
4
+ {
5
+ "id": "regex:no:fodselsnummer",
6
+ "entityType": "SSN",
7
+ "pattern": "\\b\\d{6}\\s?\\d{5}\\b",
8
+ "flags": "g",
9
+ "confidence": 0.8,
10
+ "domains": [
11
+ "identity",
12
+ "hr",
13
+ "medical"
14
+ ],
15
+ "description": "Norwegian fødselsnummer (birth number, 11 digits, DDMMYY + 5)",
16
+ "examples": [
17
+ "01019912368"
18
+ ],
19
+ "falsePositiveNotes": "11-digit sequences are common in other contexts",
20
+ "validate": "fodselsnummer"
21
+ },
22
+ {
23
+ "id": "regex:no:d_nummer",
24
+ "entityType": "SSN",
25
+ "pattern": "\\b\\d{6}\\s?\\d{5}\\b",
26
+ "flags": "g",
27
+ "confidence": 0.4,
28
+ "domains": [
29
+ "identity"
30
+ ],
31
+ "description": "Norwegian D-nummer (temporary ID for foreigners, 11 digits, day +40)",
32
+ "examples": [
33
+ "41019912345"
34
+ ],
35
+ "falsePositiveNotes": "Very broad match — 9 digits",
36
+ "validate": "dNummer"
37
+ },
38
+ {
39
+ "id": "regex:no:orgnr",
40
+ "entityType": "SSN",
41
+ "pattern": "\\b\\d{9}\\s?(?:MVA)?\\b",
42
+ "flags": "g",
43
+ "confidence": 0.6,
44
+ "domains": [
45
+ "financial",
46
+ "legal"
47
+ ],
48
+ "description": "Norwegian organization number (9 digits, optionally followed by MVA)",
49
+ "examples": [
50
+ "123456789",
51
+ "123456789 MVA"
52
+ ]
53
+ },
54
+ {
55
+ "id": "regex:no:phone",
56
+ "entityType": "PHONE",
57
+ "pattern": "\\b(?:\\+?47[\\s-]?)?\\d{2}[\\s-]?\\d{2}[\\s-]?\\d{2}[\\s-]?\\d{2}\\b",
58
+ "flags": "g",
59
+ "confidence": 0.8,
60
+ "domains": [
61
+ "contact"
62
+ ],
63
+ "description": "Norwegian phone number (8 digits, optionally with +47)",
64
+ "examples": [
65
+ "+47 12 34 56 78",
66
+ "12345678"
67
+ ]
68
+ },
69
+ {
70
+ "id": "regex:no:postal",
71
+ "entityType": "ADDRESS",
72
+ "pattern": "\\b\\d{4}\\s+[\\p{L}][\\p{L}\\s-]+\\b",
73
+ "flags": "gu",
74
+ "confidence": 0.8,
75
+ "domains": [
76
+ "contact"
77
+ ],
78
+ "description": "Norwegian postal code (4 digits) followed by city name",
79
+ "examples": [
80
+ "0001 Oslo",
81
+ "5003 Bergen"
82
+ ]
83
+ },
84
+ {
85
+ "id": "regex:no:currency_words",
86
+ "entityType": "CURRENCY",
87
+ "pattern": "(?:(?:med\\s+)?(?:bokstaver|ord)\\s*:\\s*|(?:summen|beløpet)\\s+)[\\p{L}\\s-]+(?:kroner|øre)\\b",
88
+ "flags": "giu",
89
+ "confidence": 0.9,
90
+ "domains": [
91
+ "financial"
92
+ ],
93
+ "description": "Norwegian amount written in words (e.g., \"med bokstaver: åtte tusen fem hundre kroner\")",
94
+ "examples": [
95
+ "med bokstaver: åtte tusen fem hundre kroner"
96
+ ]
97
+ },
98
+ {
99
+ "id": "regex:no:street",
100
+ "entityType": "ADDRESS",
101
+ "pattern": "[\\p{L}][\\p{L}\\s-]*(?:gata|gaten|gate|veien|vegen|vei|veg|stien|torget|plassen|plass|allé|alleen)\\s+\\d+[\\p{L}]?",
102
+ "flags": "giu",
103
+ "confidence": 0.9,
104
+ "domains": [
105
+ "contact"
106
+ ],
107
+ "description": "Norwegian street address (name + gate/veien/vei/etc. + number)",
108
+ "examples": [
109
+ "Karl Johans gate 22",
110
+ "Storgata 15",
111
+ "Bygdøy allé 3"
112
+ ]
113
+ },
114
+ {
115
+ "id": "regex:no:company",
116
+ "entityType": "COMPANY",
117
+ "pattern": "[\\p{L}][\\p{L}\\s&.']+(?:\\s+)?(?:AS|ASA|ANS|DA)\\b",
118
+ "flags": "gu",
119
+ "confidence": 0.8,
120
+ "domains": [
121
+ "legal",
122
+ "financial"
123
+ ],
124
+ "description": "Norwegian company name with legal form (AS, ASA, ANS, DA)",
125
+ "examples": [
126
+ "Equinor ASA",
127
+ "Telenor ASA",
128
+ "Nordea Bank ASA"
129
+ ]
130
+ }
131
+ ]
132
+ }
package/rules/pl.json ADDED
@@ -0,0 +1,210 @@
1
+ {
2
+ "region": "pl",
3
+ "rules": [
4
+ {
5
+ "id": "regex:pl:pesel",
6
+ "entityType": "SSN",
7
+ "pattern": "\\b\\d{2}[0-3]\\d[0-3]\\d{6}\\b",
8
+ "flags": "g",
9
+ "confidence": 0.9,
10
+ "domains": [
11
+ "identity",
12
+ "hr",
13
+ "medical"
14
+ ],
15
+ "description": "Polish PESEL national identification number (11 digits, YYMMDD + 5)",
16
+ "examples": [
17
+ "89052310002",
18
+ "02271400004"
19
+ ],
20
+ "validate": "pesel"
21
+ },
22
+ {
23
+ "id": "regex:pl:id_card",
24
+ "entityType": "SSN",
25
+ "pattern": "\\b[A-Z]{3}\\s?\\d{6}\\b",
26
+ "flags": "g",
27
+ "confidence": 0.8,
28
+ "domains": [
29
+ "identity"
30
+ ],
31
+ "description": "Polish ID card number (3 letters + 6 digits)",
32
+ "examples": [
33
+ "ABC 523456"
34
+ ],
35
+ "validate": "plIdCard"
36
+ },
37
+ {
38
+ "id": "regex:pl:passport",
39
+ "entityType": "SSN",
40
+ "pattern": "\\b[A-Z]{2}\\s?\\d{7}\\b",
41
+ "flags": "g",
42
+ "confidence": 0.7,
43
+ "domains": [
44
+ "identity"
45
+ ],
46
+ "description": "Polish passport number (2 letters + 7 digits)",
47
+ "examples": [
48
+ "AB 1234567",
49
+ "CD1234567"
50
+ ]
51
+ },
52
+ {
53
+ "id": "regex:pl:nip",
54
+ "entityType": "SSN",
55
+ "pattern": "\\b\\d{3}-?\\d{3}-?\\d{2}-?\\d{2}\\b",
56
+ "flags": "g",
57
+ "confidence": 0.85,
58
+ "domains": [
59
+ "financial",
60
+ "legal"
61
+ ],
62
+ "description": "Polish NIP tax identification number (10 digits, XXX-XXX-XX-XX)",
63
+ "examples": [
64
+ "123-456-78-19",
65
+ "1234567819"
66
+ ],
67
+ "validate": "nip"
68
+ },
69
+ {
70
+ "id": "regex:pl:regon",
71
+ "entityType": "SSN",
72
+ "pattern": "\\b\\d{9}(?:\\d{5})?\\b",
73
+ "flags": "g",
74
+ "confidence": 0.6,
75
+ "domains": [
76
+ "financial",
77
+ "legal"
78
+ ],
79
+ "description": "Polish REGON business registry number (9 or 14 digits)",
80
+ "examples": [
81
+ "123456785"
82
+ ],
83
+ "falsePositiveNotes": "9-digit REGON overlaps with many other number formats",
84
+ "validate": "regon"
85
+ },
86
+ {
87
+ "id": "regex:pl:bank_account",
88
+ "entityType": "OTHER",
89
+ "pattern": "\\b\\d{4}\\s?\\d{4}\\s?\\d{4}\\s?\\d{4}\\s?\\d{4}\\s?\\d{4}\\s?\\d{2}\\b",
90
+ "flags": "g",
91
+ "confidence": 0.85,
92
+ "domains": [
93
+ "financial"
94
+ ],
95
+ "description": "Polish bank account number (26 digits, often spaced in groups of 4)",
96
+ "examples": [
97
+ "1234 5678 9012 3456 7890 1234 56"
98
+ ]
99
+ },
100
+ {
101
+ "id": "regex:pl:phone",
102
+ "entityType": "PHONE",
103
+ "pattern": "\\b(?:\\+?48[\\s-]?)?\\d{3}[\\s-]?\\d{3}[\\s-]?\\d{3}\\b",
104
+ "flags": "g",
105
+ "confidence": 0.8,
106
+ "domains": [
107
+ "contact"
108
+ ],
109
+ "description": "Polish phone number (9 digits, optionally with +48 prefix)",
110
+ "examples": [
111
+ "+48 600 123 456",
112
+ "600-123-456",
113
+ "48 600123456"
114
+ ]
115
+ },
116
+ {
117
+ "id": "regex:pl:postal",
118
+ "entityType": "ADDRESS",
119
+ "pattern": "\\b\\d{2}-\\d{3}\\s+[\\p{L}][\\p{L}\\s-]+\\b",
120
+ "flags": "gu",
121
+ "confidence": 0.8,
122
+ "domains": [
123
+ "contact"
124
+ ],
125
+ "description": "Polish postal code (XX-XXX) followed by city name",
126
+ "examples": [
127
+ "00-950 Warszawa",
128
+ "31-501 Kraków",
129
+ "80-244 Gdańsk Wrzeszcz"
130
+ ]
131
+ },
132
+ {
133
+ "id": "regex:pl:currency_words",
134
+ "entityType": "CURRENCY",
135
+ "pattern": "(?:słownie:\\s*)[\\p{L}\\s]+(?:złot(?:ych|y|e)|groszy|grosz(?:e)?)\\b",
136
+ "flags": "giu",
137
+ "confidence": 0.9,
138
+ "domains": [
139
+ "financial"
140
+ ],
141
+ "description": "Polish amount written in words after \"słownie:\" (e.g., \"słownie: osiem tysięcy pięćset złotych\")",
142
+ "examples": [
143
+ "słownie: osiem tysięcy pięćset złotych"
144
+ ]
145
+ },
146
+ {
147
+ "id": "regex:pl:street",
148
+ "entityType": "ADDRESS",
149
+ "pattern": "(?:ul\\.|al\\.|pl\\.|os\\.)\\s+[\\p{L}][\\p{L}\\s]+\\s+\\d+[\\p{L}]?(?:\\s*[/\\\\]\\s*\\d+[\\p{L}]?)?",
150
+ "flags": "gu",
151
+ "confidence": 0.9,
152
+ "domains": [
153
+ "contact"
154
+ ],
155
+ "description": "Polish street address (ul./al./pl./os. + name + number)",
156
+ "examples": [
157
+ "ul. Floriańska 27/3",
158
+ "ul. Juliusza Słowackiego 15/8",
159
+ "al. Krakowska 42",
160
+ "os. Złotego Wieku 12"
161
+ ]
162
+ },
163
+ {
164
+ "id": "regex:pl:company",
165
+ "entityType": "COMPANY",
166
+ "pattern": "[\\p{L}][\\p{L}\\s]+(?:Sp(?:ółka)?\\s*z\\s*o\\.?\\s*o\\.?|Spółka\\s+z\\s+ograniczon[\\p{L}]+\\s+odpowiedzialno[\\p{L}]+|Sp\\.\\s*j\\.|S\\.A\\.|Sp\\.\\s*k\\.)",
167
+ "flags": "gu",
168
+ "confidence": 0.9,
169
+ "domains": [
170
+ "legal",
171
+ "financial"
172
+ ],
173
+ "description": "Polish company name with legal form (Sp. z o.o., S.A., Sp. j., Sp. k.)",
174
+ "examples": [
175
+ "Santander Bank Polska S.A.",
176
+ "NOVAMED Spółka z ograniczoną odpowiedzialnością"
177
+ ]
178
+ },
179
+ {
180
+ "id": "regex:pl:court_case",
181
+ "entityType": "OTHER",
182
+ "pattern": "\\b[IVXLCDM]+\\s+(?:K|C|Ca|Cz|Co|Gz|Ga|GCo|GC)\\s+\\d+\\/\\d{2,4}\\b",
183
+ "flags": "g",
184
+ "confidence": 0.9,
185
+ "domains": [
186
+ "legal"
187
+ ],
188
+ "description": "Polish court case signature (e.g., \"III K 123/24\", \"I C 456/2023\")",
189
+ "examples": [
190
+ "III K 123/24",
191
+ "I C 456/2023"
192
+ ]
193
+ },
194
+ {
195
+ "id": "regex:pl:krs",
196
+ "entityType": "OTHER",
197
+ "pattern": "\\b\\d{4}\\/\\d{8}\\/\\d{4}\\b",
198
+ "flags": "g",
199
+ "confidence": 0.9,
200
+ "domains": [
201
+ "legal",
202
+ "financial"
203
+ ],
204
+ "description": "Polish KRS company registry number",
205
+ "examples": [
206
+ "0000/12345678/0001"
207
+ ]
208
+ }
209
+ ]
210
+ }