Skip to content

Commit

Permalink
Remove kvstore and move everything to park 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pteichman committed Sep 5, 2012
1 parent b095d8d commit ac5e9cc
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 633 deletions.
4 changes: 2 additions & 2 deletions cobe/brain.py
Expand Up @@ -3,10 +3,10 @@
import itertools
import logging
import math
import park

from cobe.analysis import (
AccentNormalizer, StemNormalizer, WhitespaceAnalyzer)
from cobe.kvstore import SqliteStore
from cobe.model import Model
from cobe.search import RandomWalkSearcher
from cobe.utils import itime
Expand Down Expand Up @@ -42,7 +42,7 @@ class Brain(object):
def __init__(self, filename):
self.analyzer = StandardAnalyzer()

store = SqliteStore(filename)
store = park.SQLiteStore(filename)

self.model = Model(self.analyzer, store)
self.searcher = RandomWalkSearcher(self.model)
Expand Down
6 changes: 3 additions & 3 deletions cobe/commands.py
Expand Up @@ -4,14 +4,14 @@
import fileinput
import logging
import os
import park
import re
import readline
import sys

from . import analysis

from .brain import Brain
from .kvstore import SqliteStore
from .model import Model
from .varint import decode, decode_one, encode_one

Expand All @@ -26,7 +26,7 @@ def add_subparser(cls, parser):

@staticmethod
def run(args):
store = SqliteStore("cobe.store")
store = park.SQLiteStore("cobe.store")
analyzer = analysis.WhitespaceAnalyzer()
model = Model(analyzer, store)

Expand All @@ -40,7 +40,7 @@ def run(args):

print "3-gram counts:"
get_token = model.tokens.get_token
for ngram, count in model._prefix_items("3", skip_prefix=True):
for ngram, count in model._prefix_items("3", strip_prefix=True):
# This needs a more efficient way to get the token ids,
# maybe a simple varint-aware string split.
grams = [get_token(encode_one(i)) for i in decode(ngram)]
Expand Down
312 changes: 0 additions & 312 deletions cobe/kvstore.py

This file was deleted.

0 comments on commit ac5e9cc

Please sign in to comment.