Skip to content

Instantly share code, notes, and snippets.

@jimregan
jimregan / dict
Last active January 13, 2017 18:28
ag EH G
ag(2) AE G
ag(3) IH G
an AA N
an(2) AE N
an(3) N
féin F EY N
féin(2) HH EY N
laoghaire L EY R AE
laoghaire(2) L EY R IH
version=28
section=general
language=Irish
iso-code=gle
punctuation-chars=discard-all
archive=no
email=jaoregan@tcd.ie
affiliation=Trinity College, Dublin
@jimregan
jimregan / strlwr_irish.c
Last active November 3, 2016 06:42
Irish strlwr
/*
* Copyright 2016 Trinity College, Dublin
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
#!/usr/bin/perl
use POSIX;
sub round {
my $num = shift;
my $by = shift;
my $half = ceil($by / 2);
if (($num % $by) >= $half) {
@jimregan
jimregan / pick-first.cc
Last active April 1, 2016 15:26
Pick first analysis in an Apertium stream
/*
* Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@jimregan
jimregan / 00006269.chunked
Last active March 1, 2016 00:40
Some ga.wikipedia text, tagged, corrected
[S
[NP nithe ní+Noun+Masc+Com+Pl+@NP beo beo+Adj+Comp NP]
[PP i i+Prep+Simp+@PP_ADVL
[NP gcoitinne coitinne+Noun+Fem+Com+Sg+Ecl+@P< NP] PP] S]
@jimregan
jimregan / feck-lowpass.pl
Last active March 21, 2016 11:43
Formant resonator, speech processing 2
#!/usr/bin/perl
use warnings;
use strict;
#use GD::Graph;
my $frequency = 0;
my $amplitude = 1;
my $phase = 0;
#include <iostream>
#include <vector>
using namespace std;
vector<string>
getNames(string in)
{
vector<string> out;
char c = in[0];
@jimregan
jimregan / test_escapes.cc
Created November 16, 2015 11:29
test escapes
#include <iostream>
#include <string>
#include <map>
#include <cwchar>
#include <cstring>
using namespace std;
struct WS
{
@jimregan
jimregan / bigram-counts.pl
Last active August 29, 2015 14:15
Tesseract gle_uncial bits
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode STDOUT, ":utf8";
binmode STDIN, ":utf8";
my $last = '';