Ejemplo n.º 1
0
import io
import json
from lib import node
from lib.generator import size_function

try:

    with open("json/unicode-case.json", "r") as stream:
        datas = json.load(stream)

    nd = node.RootNode()

    for data in datas:
        nd.extend(data["code"], data["lower"])
        ## nd.extend(data["upper"], data["lower"])
        ## nd.extend(data["fold"], data["lower"])
        ## nd.extend(data["title"], data["lower"])

    with open("dist/downcase_size_unicos_in.c", "w") as stream:
        size_function.write("downcase_size_unicos_in", nd, stream)

except KeyboardInterrupt:

    pass
Ejemplo n.º 2
0
import io
import json
from lib import node
from lib.generator import size_function

try:

    with open("json/unicode-case.json", "r") as stream:
        datas = json.load(stream)

    nd = node.RootNode()

    for data in datas:
        nd.extend(data["code"], data["title"])
        ## nd.extend(data["upper"], data["title"])
        ## nd.extend(data["lower"], data["title"])
        ## nd.extend(data["fold"], data["title"])

    with open("dist/titlecase_size_unicos_in.c", "w") as stream:
        size_function.write("titlecase_size_unicos_in", nd, stream)

except KeyboardInterrupt:

    pass
Ejemplo n.º 3
0
import io
import json
from lib import node
from lib.generator import size_function

try:

    with open("json/unicode-case.json", "r") as stream:
        datas = json.load(stream)

    nd = node.RootNode()

    for data in datas:
        nd.extend(data["code"], data["fold"])
        ## nd.extend(data["lower"], data["fold"])
        ## nd.extend(data["upper"], data["fold"])
        ## nd.extend(data["title"], data["fold"])

    with open("dist/foldcase_size_unicos_in.c", "w") as stream:
        size_function.write("foldcase_size_unicos_in", nd, stream)

except KeyboardInterrupt:

    pass
Ejemplo n.º 4
0
import io
import json
from lib import node
from lib.generator import size_function

try:

    with open("json/unicode-normalization.json", "r") as stream:
        datas = json.load(stream)

    nd = node.RootNode()

    for data in datas:
        nd.extend(data["code"], data["c"])
        ## nd.extend(data["d"], data["c"])
        ## nd.extend(data["kc"], data["c"])
        ## nd.extend(data["kd"], data["c"])

    with open("dist/normalize_nfc_size_unicos_in.c", "w") as stream:
        size_function.write("normalize_nfc_size_unicos_in", nd, stream)

except KeyboardInterrupt:

    pass