Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
import nltk | |
with open('sample.txt', 'r') as f: | |
sample = f.read() | |
sentences = nltk.sent_tokenize(sample) | |
tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences] | |
tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences] | |
chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True) |
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. |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'wukong' | |
require 'wukong/encoding' | |
require 'configliere' ; Configliere.use(:commandline, :env_var, :define) | |
require 'set' | |
Settings.define :id_field, :type => Integer, :default => 0, :required => true, :description => "What field to use as the document id. (-1) to assign ids" | |
Settings.define :text_field, :type => Integer, :default => 1, :required => true, :description => "Which field is the text field?" |
{%- macro form_field_label(field) -%} | |
<label for="{{ field.id }}">{{ field.label.text }} | |
{%- if field.flags.required -%} | |
<abbr title="Diese Feld muss angegeben werden">*</abbr> | |
{%- endif %}</label> | |
{% endmacro %} | |
{%- macro form_field_description(field) -%} | |
{% if field.description %} | |
<span class="descr">{{ field.description }}</span> |
class JsonSerializableMixin(object): | |
def __json__(self, request): | |
""" | |
Converts all the properties of the object into a dict for use in json. | |
You can define the following in your class | |
_json_eager_load : | |
list of which child classes need to be eagerly loaded. This applies | |
to one-to-many relationships defined in SQLAlchemy classes. |
"""SQLAlchemy Metadata and Session object""" | |
import datetime | |
import json | |
import time | |
from sqlalchemy import MetaData | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
__all__ = ['Session', 'metadata', 'Model', 'SchemaEncoder'] |
# Read the contents of ~/.path into $PATH, if ~/.path exists. ~/.path should be a file | |
# consisting of one path on each line, such as: | |
# | |
# ~$ cat ~/.path | |
# # vim: ft=sh | |
# ~/usr/bin | |
# /opt/local/bin | |
# ... etc ... | |
# | |
# Note that comments begin with a hash (#). |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.