Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import collections | |
import functools | |
import itertools | |
import re | |
# Grab this like so: | |
# curl -O http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Prints human-readable summary of an FST channel model.""" | |
import math | |
import sys | |
import unicodedata | |
import pywrapfst |
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 1 column, instead of 2 in line 7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Spanish g2p covering grammar, adapted from: | |
## | |
## https://en.wikipedia.org/wiki/Spanish_orthography | |
## https://en.wikipedia.org/wiki/Spanish_phonology | |
## | |
## We don't encode any conditioning information here, though it's present in the | |
## articles. | |
b b | |
b β | |
c θ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""English function words. | |
Sets of English function words, based on | |
E.O. Selkirk. 1984. Phonology and syntax: The relationship between | |
sound and structure. Cambridge: MIT Press. (p. 352f.) | |
The categories are of my own creation. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Applies a given normalization form to file and detects changes. | |
This script reads text files line by line, decoding them into Unicode using a | |
specified encoding (by default, UTF-8), and then applying a specified Unicode | |
normalization (by default, NFC). If, for any line this normalization is not | |
no-op (i.e., if it changes the line) it logs a fatal error with the filename and | |
affected line number. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Delimited subsequential finite-state transducer template.""" | |
import pynini | |
EPSILON = 0 | |
LEFT_DELIMITER = 2 # [STX]. | |
RIGHT_DELIMITER = 3 # [ETX]. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Constructs resources for Zodiac cipher 408: | |
# | |
# * Plaintext and ciphertext FARs | |
# * Unweighted "key" FSTs and "channel" (hypothesis space) FSTs | |
# * A textual symbol table for plaintext and ciphertext | |
# | |
# Requires: Pynini and OpenFst with the FAR extension. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Computes relative error reduction given two percentages. | |
// | |
// This computes relative error reduction (RER) given two percentages, the | |
// "before" and "after" accuracy. | |
// | |
// This is given by: | |
// | |
// RER = 1 - (1 - new_accuracy) / (1 - old_accuracy) | |
// | |
// To compile: gcc -O3 -std=c99 -o rer rer.c |