Skip to content

Instantly share code, notes, and snippets.

@logogin
logogin / nltk-intro.py
Created October 18, 2017 14:10 — forked from alexbowe/nltk-intro.py
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.
@logogin
logogin / access_policy.template
Created April 18, 2017 15:25 — forked from pschipitsch/access_policy.template
AWS Elasticsearch Service Access Policy Terraform Template
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"es:ESHttpGet",
"es:ESHttpHead",
"es:ESHttpPost",
<customMapSource>
<name>Google Maps</name>
<minZoom>0</minZoom>
<maxZoom>20</maxZoom>
<tileType>PNG</tileType>
<tileUpdate>IfNoneMatch</tileUpdate>
<url>http://mt{$serverpart}.google.com/vt/lyrs=m@176103410&amp;hl=en-US&amp;x={$x}&amp;y={$y}&amp;z={$z}&amp;s=Galileo&amp;scale=1</url>
<serverParts>0 1 2 3</serverParts>
</customMapSource>