Skip to content

Instantly share code, notes, and snippets.

View RyanMcCarl's full-sized avatar

RyanM RyanMcCarl

View GitHub Profile
@RyanMcCarl
RyanMcCarl / article-summarizer.py
Created July 4, 2018 23:29 — forked from jackschultz/article-summarizer.py
Article summarizer written in python.
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
import string
class SentenceRank(object):
def __init__(self, body, title):
self.body = body
self.sentence_list = nltk.tokenize.sent_tokenize(self.body)[:]
self.title = title
@RyanMcCarl
RyanMcCarl / article-summarizer.py
Created July 4, 2018 23:29 — forked from jackschultz/article-summarizer.py
Article summarizer written in python.
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
import string
class SentenceRank(object):
def __init__(self, body, title):
self.body = body
self.sentence_list = nltk.tokenize.sent_tokenize(self.body)[:]
self.title = title
@RyanMcCarl
RyanMcCarl / EXAMPLE.js
Created June 13, 2018 06:39 — forked from redaktor/EXAMPLE.js
nlp_compromise metrics proposal as standalone example
// TODO - make logic_negate and abbreviations to lexicon as resource file (i18n, language aware, seperate data and logic)
// the best way might be a dictionary with flags where we can easily derive the lexicon by Object.keys and map, like
/* dictionary: {
"CP": [
{v:'is', weak: 1},
...
],
...
};
*/
@RyanMcCarl
RyanMcCarl / EXAMPLE.js
Created June 13, 2018 06:39 — forked from redaktor/EXAMPLE.js
nlp_compromise metrics proposal as standalone example
// TODO - make logic_negate and abbreviations to lexicon as resource file (i18n, language aware, seperate data and logic)
// the best way might be a dictionary with flags where we can easily derive the lexicon by Object.keys and map, like
/* dictionary: {
"CP": [
{v:'is', weak: 1},
...
],
...
};
*/
@RyanMcCarl
RyanMcCarl / bullshit_generator.py
Created June 13, 2018 06:36 — forked from SteveClement/bullshit_generator.py
Found (https://mail.python.org/pipermail/python-list/2009-March/530858.html) this nice Bullshit Generator by Pierre Denis. Adapted it to Python3
'''
======================================================================
Bullshit Generator
by Pierre Denis, March 2009
======================================================================
'''
# --------------------------------------------------
# grammar engine
# --------------------------------------------------
@RyanMcCarl
RyanMcCarl / abc.tsv
Created March 30, 2017 21:36 — forked from fasiha/abc.tsv
Kanji ABC graphemes in Unicode. An attempt has been made for all graphemes using Unicode, BabelStone Han Private Use Area (PUA, http://www.babelstone.co.uk/Fonts/PUA.html), and IDSes (using ⿰⿱⿲⿳⿻ &c).
LE RI TO BO EN FR A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
𠃊
广 U+F2AD ⿱⺍冖 ⿱亠口 𠆢 U+F2BC 𠀉
⿱龸口 ⿳彐冖又
廿 U+F2E4 U+F2CE
⿱宀儿 𧘇 𠂇 𢦏 U+F2CF
_ 𤴓 U+F2F6
_ _ 𤰔 ⿱日匂 _ 𠂆
_ _ _ ⿱爫𠙻 ⿱一𧘇 𠫓 _
_ _ _ _ 𠂤 U+F2C9 _
import sqlite3
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d