Skip to content

Instantly share code, notes, and snippets.

View jmacc93's full-sized avatar

Joe Miller jmacc93

  • earth
View GitHub Profile
#!/usr/bin/python
# Generated by gemini from my specification, lightly modified by me
# Finds and prints ngrams from a text file with one word per line (so I could find ngrams in my xkbcat output, primarily)
import argparse
import sys
import csv
from collections import Counter
def parse_arguments():
@jmacc93
jmacc93 / function_signature_composition_solver.js
Created January 14, 2024 10:53
A prototype hypertree solver, and solution reifier, for automatic function composition
/*
This file shouldn't have any dependencies, just run it via `node`. Should work. It'll print 'Done' if all the tests pass
Glossary:
* sig -- is short for 'signature' as in function signatures. This generally represents a hyperedge in a hypergraph
* 'input', 'output' -- for automatic function composition (AFC) purposes. Generally, 'input' is for terminal nodes, 'output' is for root nodes
* app -- short for application. For AFC purposes. Its the structure that `makeAppsFromCompoundSig` yields, which looks like a function call / expression (in object form)
This contains:
* A bunch of functions to make the following stuff work