Skip to content

Instantly share code, notes, and snippets.

Kyle P. Johnson kylepjohnson

Block or report user

Report or block kylepjohnson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pycrfsuite on py3.7
Running python-crfsuite-0.9.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lbeiimu8/python-crfsuite-0.9.5/egg-dist-tmp-3yelhlin
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
pycrfsuite/_pycrfsuite.cpp: In function ‘void __Pyx__ExceptionSave(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pycrfsuite/_pycrfsuite.cpp:14140:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
*type = tstate->exc_type;
^~~~~~~~
curexc_type
pycrfsuite/_pycrfsuite.cpp:14141:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
*value = tstate->exc_value;
^~~~~~~~~
View gist:e274602907ef865282da00d2362c7a18
#!/bin/bash
set -e
apt-get update -q
apt-get upgrade -q -y
apt-get install -y software-properties-common
add-apt-repository ppa:webupd8team/java < /dev/null
apt-get update -q
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
View subsript_pairs_to_dict.py
import os
with open(os.path.expanduser('~/Downloads/subscript-non-pairs')) as fo:
text = fo.read()
pairs = text.split('\n\n')
map_sub_nosub = {}
for pair in pairs:
key, val = pair.split('\n')
@kylepjohnson
kylepjohnson / subscript-non-pairs
Created Jun 5, 2017
Pairs of subscript chars w/o
View subscript-non-pairs
'\u1fbc', # ᾼ Greek Capital Letter Alpha with Prosgegrammeni
'\u0391',# Α Greek Capital Letter Alpha
'\u1fcc', # ῌ Greek Capital Letter Eta with Prosgegrammeni
'\u0397', # Η Greek Capital Letter Eta
'\u1ffc' # ῼ Greek Capital Letter Omega with Prosgegrammeni
'\u03a9', # Ω Greek Capital Letter Omega
'\u1f88', # ᾈ Greek Capital Letter Alpha with Psili and Prosgegrammeni
@kylepjohnson
kylepjohnson / get_prev_next.ipynb
Created Apr 8, 2016
Example to page through dict
View get_prev_next.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View greek_polytonic_characters.py
# https://en.wikipedia.org/wiki/Greek_diacritics#Unicode
#Upper Case Vowels
UPPER = ['Α', 'Ε', 'Η', 'Ι', 'Ο', 'Υ', 'Ω', '', '', '']
UPPER_ACUTE = ['Ά', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ']
UPPER_GRAVE = ['', '', '', '', '', '', '']
UPPER_SMOOTH = ['', '', '', '', '', '', '', '', '']
UPPER_SMOOTH_ACUTE = ['', '', '', '', '', '', '', '', '']
UPPER_SMOOTH_GRAVE = ['', '', '', '', '', '', '', '', '']
@kylepjohnson
kylepjohnson / make_phi5_vocab.py
Created Nov 19, 2015
Get all unique words from PHI5, output to file
View make_phi5_vocab.py
# coding: utf-8
# In[1]:
import os
import re
from cltk.corpus.utils.formatter import assemble_phi5_author_filepaths
from cltk.corpus.utils.formatter import phi5_plaintext_cleanup
@kylepjohnson
kylepjohnson / morpheus-ubuntu-good-install
Created Aug 9, 2015
On Ubuntu 14.04, GCC 4.8.2. Was this make successful?
View morpheus-ubuntu-good-install
$ make
cd greeklib; make greeklib.a
make[1]: Entering directory `/vagrant/morpheus/src/greeklib'
gcc -O2 -I../includes -c -o Fclose.o Fclose.c
Fclose.c: In function ‘xFree’:
Fclose.c:28:2: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
free(p);
^
gcc -O2 -I../includes -c -o addaccent.o addaccent.c
gcc -O2 -I../includes -c -o addbreath.o addbreath.c
@kylepjohnson
kylepjohnson / morpheus-ubuntu-update
Last active Aug 29, 2015
Mropheus updade.sh (Ubuntu 14.04)
View morpheus-ubuntu-update
$ ./update.sh
buildend -L nom
endtables/ascii/a_ae.asc
endtables/ascii/e_es.asc
endtables/ascii/es_ae.asc
endtables/ascii/as_ae.asc
endtables/ascii/us_i.asc
endtables/ascii/ius_i.asc
endtables/ascii/os_i.asc
endtables/ascii/0_i.asc
View morpheus_alatius_ubuntu14
vagrant@vagrant-ubuntu-trusty-64:/vagrant/morpheus/src$ make
cd greeklib; make greeklib.a
make[1]: Entering directory `/vagrant/morpheus/src/greeklib'
gcc -O2 -I../includes -c -o Fclose.o Fclose.c
Fclose.c: In function ‘xFree’:
Fclose.c:28:2: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
free(p);
^
gcc -O2 -I../includes -c -o addaccent.o addaccent.c
gcc -O2 -I../includes -c -o addbreath.o addbreath.c
You can’t perform that action at this time.