Format text is literal; class runs are {digits(n)} {upper(n)} {lower(n)}; a string is a format

This commit is contained in:
2026-09-02 12:37:21 +02:00
parent 99d8aa0fb7
commit ff4b243148
29 changed files with 308 additions and 267 deletions
+6 -6
View File
@@ -9,16 +9,16 @@
}
],
"street-number": [
{ "format": "10" },
{ "format": "100", "weight": 2 },
{ "format": "1000", "weight": 0.5 },
{ "format": "10100", "weight": 0.3 }
{ "format": "{int(10,99)}" },
{ "format": "{int(100,999)}", "weight": 2 },
{ "format": "{int(1000,9999)}", "weight": 0.5 },
{ "format": "{int(10,99)}{int(100,999)}", "weight": 0.3 }
],
"locality": ["Albany", "Atlanta", "Austin", "Baltimore", "Boston", "Charlotte", "Chicago", "Cincinnati", "Cleveland", "Columbus", "Dallas", "Denver", "Detroit", "El Paso", "Fort Worth", "Fresno", "Houston", "Indianapolis", "Jacksonville", "Kansas City", "Las Vegas", "Long Beach", "Los Angeles", "Memphis", "Mesa", "Miami", "Milwaukee", "Minneapolis", "Nashville", "New Orleans", "Oakland", "Oklahoma City", "Omaha", "Orlando", "Philadelphia", "Phoenix", "Pittsburgh", "Portland", "Raleigh", "Sacramento", "San Antonio", "San Diego", "San Jose", "Seattle", "St. Louis", "Tampa", "Tucson", "Tulsa"],
"region": ["AL", "AZ", "CA", "CO", "CT", "FL", "GA", "IL", "IN", "KY", "LA", "MA", "MD", "MI", "MN", "MO", "NC", "NJ", "NV", "NY", "OH", "OK", "OR", "PA", "TN", "TX", "VA", "WA", "WI"],
"postal-code": [
{ "format": "10000" },
{ "format": "10000-0000", "weight": 0.3 }
{ "format": "{int(10000,99999)}" },
{ "format": "{int(10000,99999)}-{digits(4)}", "weight": 0.3 }
]
}
]
+1 -1
View File
@@ -1,6 +1,6 @@
[
{
"format": "##{x}{x}{x}{x}{x}{x}",
"format": "#{x}{x}{x}{x}{x}{x}",
"x": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"],
"weight": 2
},
+6 -6
View File
@@ -4,12 +4,12 @@
"month": ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
"day": ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28"],
"year": [
{ "format": "#1970" },
{ "format": "#1980" },
{ "format": "#1990", "weight": 2 },
{ "format": "2#0#00", "weight": 3 },
{ "format": "2#0#10", "weight": 3 },
{ "format": "2#020", "weight": 2 }
{ "format": "197{digits(1)}" },
{ "format": "198{digits(1)}" },
{ "format": "199{digits(1)}", "weight": 2 },
{ "format": "200{digits(1)}", "weight": 3 },
{ "format": "201{digits(1)}", "weight": 3 },
{ "format": "202{digits(1)}", "weight": 2 }
]
}
]
+1 -1
View File
@@ -2,7 +2,7 @@
{
"format": "{o}.{o}.{o}.{o}",
"weight": 8,
"o": [{ "format": "0", "weight": 3 }, { "format": "10", "weight": 4 }, { "format": "#100", "weight": 2 }]
"o": [{ "format": "{digits(1)}", "weight": 3 }, { "format": "{int(10,99)}", "weight": 4 }, { "format": "1{digits(2)}", "weight": 2 }]
},
{
"format": "{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}"
+4 -4
View File
@@ -3,13 +3,13 @@
"format": "({area}) {exch}-{line}",
"weight": 2,
"area": ["202", "212", "213", "305", "312", "404", "415", "469", "503", "512", "602", "617", "646", "702", "718", "720", "737", "773", "786", "808", "917"],
"exch": [{ "format": "100" }],
"line": [{ "format": "0000" }]
"exch": [{ "format": "{int(100,999)}" }],
"line": [{ "format": "{digits(4)}" }]
},
{
"format": "{area}-{exch}-{line}",
"area": ["202", "212", "213", "305", "312", "404", "415", "469", "503", "512", "602", "617", "646", "702", "718", "720", "737", "773", "786", "808", "917"],
"exch": [{ "format": "100" }],
"line": [{ "format": "0000" }]
"exch": [{ "format": "{int(100,999)}" }],
"line": [{ "format": "{digits(4)}" }]
}
]
+7 -7
View File
@@ -2,15 +2,15 @@
{
"format": "${amt}.{cents}",
"amt": [
{ "format": "1", "weight": 2 },
{ "format": "10", "weight": 4 },
{ "format": "100", "weight": 3 },
{ "format": "1#,000", "weight": 1 },
{ "format": "10#,000", "weight": 0.4 },
{ "format": "100#,000", "weight": 0.1 }
{ "format": "{int(1,9)}", "weight": 2 },
{ "format": "{int(10,99)}", "weight": 4 },
{ "format": "{int(100,999)}", "weight": 3 },
{ "format": "{int(1,9)},{digits(3)}", "weight": 1 },
{ "format": "{int(10,99)},{digits(3)}", "weight": 0.4 },
{ "format": "{int(100,999)},{digits(3)}", "weight": 0.1 }
],
"cents": [
{ "format": "00", "weight": 3 },
{ "format": "{digits(2)}", "weight": 3 },
"49",
"95",
"99"
+1 -1
View File
@@ -1,3 +1,3 @@
[
{ "format": "100-00-0000" }
{ "format": "{int(100,999)}-{digits(2)}-{digits(4)}" }
]
+1 -1
View File
@@ -2,7 +2,7 @@
{
"format": "{hour}:{minute} {ampm}",
"hour": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
"minute": [{ "format": "{t}0", "t": ["0", "1", "2", "3", "4", "5"] }],
"minute": [{ "format": "{t}{digits(1)}", "t": ["0", "1", "2", "3", "4", "5"] }],
"ampm": ["AM", "PM"]
}
]
+1 -1
View File
@@ -1,7 +1,7 @@
[
{
"format": "{pre}{n}.{n}.{n}{suffix}",
"n": [{ "format": "0", "weight": 3 }, { "format": "10" }],
"n": [{ "format": "{digits(1)}", "weight": 3 }, { "format": "{int(10,99)}" }],
"pre": ["", { "format": "v", "weight": 0.4 }],
"suffix": ["", { "format": "-{tag}.{m}", "tag": ["alpha", "beta", "rc"], "m": ["1", "2", "3"], "weight": 0.3 }]
}