Skip to content

Commit

Permalink
update op dict script.
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-wang committed Apr 11, 2020
1 parent bf46fb2 commit fd098d2
Showing 1 changed file with 34 additions and 37 deletions.
71 changes: 34 additions & 37 deletions tables/operator-dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ def toHexa(character):
"infixEntriesWithDefaultValues": [],
"infixEntriesWithSpacing4": [],
"infixEntriesWithSpacing3": [],
"infixEntriesWithSpacing5AndAccent": [],
"infixEntriesWithSpacing5AndAccentStretchy": [],
"infixEntriesWithSpacing5AndStretchy": [],
"postfixEntriesWithSpacing0AndAccent": [],
"prefixEntriesWithSpacing0AndStretchySymmetricFence": [],
"postfixEntriesWithSpacing0AndStretchySymmetricFence": [],
"postfixEntriesWithSpacing0AndAccentStretchy": [],
"prefixEntriesWithLspace1Rspace2AndSymmetricMovablelimitsLargeop": [],
"prefixEntriesWithLspace1Rspace2AndSymmetricLargeop": [],
"prefixEntriesWithLspace0Rspace1AndSymmetricLargeop": [],
"prefixEntriesWithLspace0Rspace0": [],
"postfixEntriesWithLspace0Rspace0": [],
"postfixEntriesWithLspace0Rspace0AndStretchy": [],
"prefixEntriesWithLspace3Rspace3AndSymmetricLargeop": [],
}
otherEntries={}
otherValuesCount={}
Expand All @@ -79,7 +77,6 @@ def toHexa(character):
"symmetric",
"largeop",
"movablelimits",
"accent",
"fence",
"separator"])

Expand Down Expand Up @@ -109,35 +106,13 @@ def toHexa(character):
knownTables["infixEntriesWithSpacing3"].append(character)
continue

if (value["lspace"] == 5 and
value["rspace"] == 5 and
value["properties"] == {'accent': True} and
form == "infix"):
knownTables["infixEntriesWithSpacing5AndAccent"].append(character)
continue

if (value["lspace"] == 5 and
value["rspace"] == 5 and
value["properties"] == {'accent': True, 'stretchy': True} and
form == "infix"):
knownTables["infixEntriesWithSpacing5AndAccentStretchy"].append(character)
continue

if (value["lspace"] == 5 and
value["rspace"] == 5 and
value["properties"] == {'stretchy': True} and
form == "infix"):
knownTables["infixEntriesWithSpacing5AndStretchy"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" in value and
value["properties"] == {'accent': True} and
form == "postfix"):
knownTables["postfixEntriesWithSpacing0AndAccent"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" in value and
Expand All @@ -154,14 +129,6 @@ def toHexa(character):
knownTables["postfixEntriesWithSpacing0AndStretchySymmetricFence"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" in value and
value["properties"] == {'accent': True, 'stretchy': True} and
form == "postfix"):
knownTables["postfixEntriesWithSpacing0AndAccentStretchy"].append(character)
continue

if (value["lspace"] == 1 and
value["rspace"] == 2 and
"properties" in value and
Expand All @@ -186,6 +153,36 @@ def toHexa(character):
knownTables["prefixEntriesWithLspace0Rspace1AndSymmetricLargeop"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" not in value and
form == "prefix"):
knownTables["prefixEntriesWithLspace0Rspace0"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" not in value and
form == "postfix"):
knownTables["postfixEntriesWithLspace0Rspace0"].append(character)
continue

if (value["lspace"] == 0 and
value["rspace"] == 0 and
"properties" in value and
value["properties"] == {'stretchy': True} and
form == "postfix"):
knownTables["postfixEntriesWithLspace0Rspace0AndStretchy"].append(character)
continue

if (value["lspace"] == 3 and
value["rspace"] == 3 and
"properties" in value and
value["properties"] == {'symmetric': True, 'largeop': True} and
form == "prefix"):
knownTables["prefixEntriesWithLspace3Rspace3AndSymmetricLargeop"].append(character)
continue

v = str(value)
if v not in otherValuesCount:
otherValuesCount[v] = 0
Expand Down

0 comments on commit fd098d2

Please sign in to comment.