I hereby claim:
- I am remyporter on github.
- I am remyporter (https://keybase.io/remyporter) on keybase.
- I have a public key whose fingerprint is D840 B879 0B81 8F62 5F75 5BF9 E7DF E43C 3AB9 6896
To claim this, I am signing this object:
#import <Foundation/Foundation.h> | |
@interface TextProcessor : NSObject { | |
NSLinguisticTagger* tagger; | |
} | |
- (id) initWithLanguage:(NSString*) language; | |
- (void) setString:(NSMutableString*) str; | |
- (NSRange) expandToSentenceBreak:(NSRange) original; | |
- (void) stringEditedInRange:(NSRange) range changeInLength:(NSInteger) delta; | |
- (void)enumerateTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts usingBlock:(void (^)(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block; |
xindent = str(11.553572) | |
ystart = 894.94238 | |
incr = 907.44238 - 894.94238 | |
def lines(text): | |
words = text.split() | |
result = "" | |
currentLeg = "" | |
count = 0 | |
for w in words: |
from sys import argv | |
import os | |
import csv | |
import re | |
import subprocess | |
xindent = str(11.553572) | |
ystart = 894.94238 | |
incr = 907.44238 - 894.94238 |
from pyparsing import * | |
from collections import namedtuple | |
Entry = namedtuple("Entry", "description path section") | |
__currentsection = None | |
def __section(section): | |
global __currentsection | |
__currentsection = section.Section |
import linecache | |
import math | |
def wordhash(hash, wordlist="all.short", address_size=4): | |
words = [] | |
for i in range(0, len(hash), address_size): | |
hx = "00" | |
try: | |
hx = hash[i:i+address_size] | |
except IndexError as err: |
class EffectCompose(EffectMeta): | |
def __init__(cls, name, bases, dct): | |
super().__init__(name, bases, dct) | |
def compose(a,b,abort_on_fail=False): | |
if not a: | |
return b | |
if abort_on_fail: | |
def f(statecont, *args, **kwargs): | |
res = a(statecont) | |
if res.opstate: |
import sys | |
def lift_to_module(module_name, types): | |
"""Take a list of dynamically generated types, or anything really, | |
and lift them to the root level of the module. | |
I mostly use this when I do something like this: | |
>>> some_data_source = ["Foo", "Bar", "Goo"] | |
>>> types = [ | |
SomeMetaClass("TypeName"+ i, (object,), inputs) |
""" | |
>>> SomeEffect = Effect("SomeEffect", someFunc) | |
>>> OtherEffect = Effect("OtherEffect", someFunc) | |
>>> CompositeEffect = SomeEffect + OtherEffect | |
>>> newstate = CompositeEffect()(oldstate) | |
And we can generate effects, too: | |
>>> effects = [Effect("Do" + e.title(), funcGen(e)) for e in effectTypes] | |
This is the real strength of this snippet of code- generating variations of behaviors |
import random | |
choices = ["da","ja"] | |
truth = random.choice(choices) | |
false =[c for c in choices if c != truth] | |
false = false[0] | |
gods = [lambda: truth, lambda: false, lambda: random.choice(choices)] | |
a = random.choice(gods) | |
b = a | |
while b == a: | |
b = random.choice(gods) |
I hereby claim:
To claim this, I am signing this object: