Count unigrams and bigrams in the Wolfart-Ahenakew nêhiyawêwin corpus!
When building a keyboard for typing Cree, it is useful to know which graphemes are typed often, and which pairs of graphemes are typed one
""" | |
Installs your SSH key on other hosts. A fabfile for lazy people. | |
""" | |
from fabric.api import task, run, put, env, cd | |
# Use sh instead of bash. | |
env.shell = '/bin/sh -l -c' | |
@task |
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
""" | |
Creates (dumb) rainfall data. | |
Usage: | |
python3 create-data.py > rainfall.txt | |
""" |
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
from dataclasses import dataclass | |
from random import randint | |
import re | |
dn = re.compile(r'd([123456789][0123456789]*)') | |
__all__ = ['Die'] |
{ | |
"phone": { | |
"font": "Euphemia", | |
"layer": [ | |
{ | |
"id": "default", | |
"row": [ | |
{ | |
"id": 1, | |
"key": [ |
%% Huffman Code for nêhiyawêwin %% | |
%% Note: Cree strings must be written in "askiy": | |
%% - short vowels and consonants: written in ASCII | |
%% - long vowels: ê is written as e; "âîô" written as "AIO" respectively. | |
%% - it's a very grounded character encoding 😉 | |
%% | |
%% I haven't done extensive testing, but this usually uses half the bits to | |
%% represent Cree word forms. Maybe just gzip it instead? | |
-module(huff). | |
-export([encode/1, decode/1, tryit/1]). |
/** | |
* nonullfree.c -- throw errors when you call free(NULL) | |
* | |
* BUILDING: | |
* | |
* $ gcc -shared -fPIC nonullfree.c -ldl -o nonullfree.so | |
* | |
* USAGE (Linux): | |
* | |
* $ LD_PRELOAD=./nonullfree.so ./my-program |
import ctypes | |
import tempfile | |
import distutils.ccompiler | |
from pathlib import Path | |
from random import randint | |
SOURCE_CODE = f""" | |
int roll(void) {{ | |
return {randint(1, 6)}; |
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
# Copyright 2019 Eddie Antonio Santos <easantos@ualberta.ca> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |