Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
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) |
git config --global user.name "Tarcisio Coutinho" | |
git config --global user.email "[email protected]" | |
git config --global color.ui true | |
git config --global alias.s status | |
git config --global alias.c checkout | |
git config --global alias.b branch | |
git config --global alias.lol log --oneline --graph --decorate |
/* Tobin Fricke's implementation of the | |
Hoshen-Kopelman algorithm for | |
cluster labeling. | |
Copyright (c) September 9, 2000, by Tobin Fricke <[email protected]> | |
Modified 2002-03-09 Tobin Fricke | |
Modified substantially 2004-04-21 by Tobin Fricke | |
This program is written in the 1999 standard of the C language (C99). Older C |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
%YAML 1.2 | |
--- | |
name: JIRA and Confluence markup syntax | |
scope: source.atlassian-markup | |
license: MIT | |
variables: | |
other_text_mods: '\^|\~|\?\?' | |
projects: '(GD|PAAS)' | |
icons: '\((!|\?|/)\)' | |
contexts: |
#A small guide to compile openFrameworks armv7 with driver OpenGL ES / ES2 sunxi for H3 / Mali GPU on ARMBIAN OS, compatible with orangepi and bananapi.
tested on: orangepi one banana pi M2
dependencies:
apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev \
x11proto-xf86dri-dev libxfixes-dev x11proto-dri2-dev xserver-xorg-dev \
build-essential automake pkg-config libtool ca-certificates git cmake subversion
Field types are marked using C-style notation:
char[4]
indicates a 4-byte fixed-width stringuint[6]
indicates a 6-byte sequenceuint8
, uint16
, and uint32
are unsigned byte, short, and long integersint8
, int16
, and int32
are signed byte, short, and long integers