Skip to content

Instantly share code, notes, and snippets.

View goodmami's full-sized avatar

Michael Wayne Goodman goodmami

View GitHub Profile
@goodmami
goodmami / nltk-bleu.py
Created June 27, 2017 01:03
Simple multi-bleu utility using the NLTK
#!/usr/bin/env python3
# Copyright 2017 Michael Wayne Goodman <goodman.m.w@gmail.com>
# Licensed under the MIT license: https://opensource.org/licenses/MIT
import sys
import os
import gzip
import docopt
@goodmami
goodmami / lark-parsimonious.py
Created August 30, 2018 21:58
Comparing Lark and Parsimonious on JSON parsing
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# usage: python3 lark-parsimonious.py [TESTNUM]
#
# Where TESTNUM is one of:
#
# 1. Parsimonious with the faster grammar (tree-only)
# 2. Parsimonious with the faster grammar (transform data)
# 3. Parsimonious with the slower grammar (tree-only)
@goodmami
goodmami / repp.md
Created November 25, 2019 14:35
REPP notes

Regular Expression Preprocessing (REPP)

Specification

Modules

Operators

Every operator must appear as the first character on a line (in column 0).

@goodmami
goodmami / README.md
Last active September 8, 2023 04:10
Parsing JSON with regular expressions

Parsing JSON with Regular Expressions

When I learned of regular expression engines that support recursion I thought I could write a recursive-descent parser in regex. Since I've written JSON parsers a few times and it's a simple spec, I chose that as the test case. In the end I created two versions.

version 1

@goodmami
goodmami / README.md
Last active February 23, 2023 17:39
Converting ACE's Subversion repository to Git

Converting ACE from Subversion to Git

The ace-svn-to-git.sh script will use git-svn to convert ACE's Subversion repository to Git with the --stdlayout flag so the trunk, tags, and branches are handled mostly as expected (more below). The --prefix=svn/ option puts all of those tags and branches under the svn reference namespace, and the --authors-file option maps the Subversion author names to the current GitHub profiles of the three authors in ACE's history.