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 latin wordnex ex
$ ipython
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from cltk.corpus.latin.wordnet import WordNetCorpusReader
In [2]: LWN = WordNetCorpusReader()
In [3]: uirtus = LWN.lemma('uirtus', 'n', 'n-s---fn3-')
kylepjohnson /
Last active Aug 27, 2019
MWV to illustrate proposed new CLTK data types and use in an "NLP object"
"""An example of a proposed NLP pipeline system. Goals are to allow for:
1. default NLP pipeline for any given language
2. users to override default pipeline
3. users to choose alternative code (classes/methods/functions) w/in the CLTK
4. users to use their own custom code (inheriting or replacing those w/in CLTK)
View pycrfsuite on py3.7
Running python-crfsuite-0.9.5/ -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;
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
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
import os
with open(os.path.expanduser('~/Downloads/subscript-non-pairs')) as fo:
text =
pairs = text.split('\n\n')
map_sub_nosub = {}
for pair in pairs:
key, val = pair.split('\n')
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 / 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.
#Upper Case Vowels
UPPER = ['Α', 'Ε', 'Η', 'Ι', 'Ο', 'Υ', 'Ω', '', '', '']
UPPER_ACUTE = ['Ά', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ']
UPPER_GRAVE = ['', '', '', '', '', '', '']
UPPER_SMOOTH = ['', '', '', '', '', '', '', '', '']
UPPER_SMOOTH_ACUTE = ['', '', '', '', '', '', '', '', '']
UPPER_SMOOTH_GRAVE = ['', '', '', '', '', '', '', '', '']
kylepjohnson /
Created Nov 19, 2015
Get all unique words from PHI5, output to file
# 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 / 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]
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.