Skip to content

Commit

Permalink
Merge pull request blevesearch#133 from Shugyousha/typos
Browse files Browse the repository at this point in the history
Fix typos in comments and strings
  • Loading branch information
mschoch committed Dec 18, 2014
2 parents fc33752 + ef18dfe commit 59b014d
Show file tree
Hide file tree
Showing 44 changed files with 100 additions and 102 deletions.
2 changes: 1 addition & 1 deletion analysis/token_filters/porter/porter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewPorterStemmer() *PorterStemmer {

func (s *PorterStemmer) Filter(input analysis.TokenStream) analysis.TokenStream {
for _, token := range input {
// if not protected keyword, stem it
// if it is not a protected keyword, stem it
if !token.KeyWord {
stemmed := porterstemmer.StemString(string(token.Term))
token.Term = []byte(stemmed)
Expand Down
2 changes: 1 addition & 1 deletion analysis/token_filters/stemmer_filter/stemmer_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *StemmerFilter) List() []string {

func (s *StemmerFilter) Filter(input analysis.TokenStream) analysis.TokenStream {
for _, token := range input {
// if not protected keyword, stem it
// if it is not a protected keyword, stem it
if !token.KeyWord {
stemmer := <-s.stemmerPool
stemmed := stemmer.Stem(string(token.Term))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// the following tests come from the lucene
// test cases for CJK width filter
// which is our bases for using this
// which is our basis for using this
// as a substitute for that
func TestUnicodeNormalization(t *testing.T) {

Expand Down
4 changes: 2 additions & 2 deletions analysis/token_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (t TokenMap) LoadBytes(data []byte) error {
t.LoadLine(line)
line, err = bufioReader.ReadString('\n')
}
// if the err was EOF still need to process last value
// if the err was EOF we still need to process the last value
if err == io.EOF {
t.LoadLine(line)
return nil
Expand All @@ -48,7 +48,7 @@ func (t TokenMap) LoadBytes(data []byte) error {
}

func (t TokenMap) LoadLine(line string) error {
// find the start of comment, if any
// find the start of a comment, if any
startComment := strings.IndexAny(line, "#|")
if startComment >= 0 {
line = line[:startComment]
Expand Down
4 changes: 2 additions & 2 deletions analysis/token_map/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ const Name = "custom"
func GenericTokenMapConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenMap, error) {
rv := analysis.NewTokenMap()

// first try to load by filename
// first: try to load by filename
filename, ok := config["filename"].(string)
if ok {
err := rv.LoadFile(filename)
return rv, err
}
// next look for an inline word list
// next: look for an inline word list
tokens, ok := config["tokens"].([]interface{})
if ok {
for _, token := range tokens {
Expand Down
2 changes: 1 addition & 1 deletion index/store/boltdb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (i *Batch) Execute() error {
return i.store.db.Update(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(i.store.bucket))

// first processed the merges
// first process the merges
for k, mc := range i.merges {
val := b.Get([]byte(k))
var err error
Expand Down
12 changes: 6 additions & 6 deletions index/store/boltdb/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "b" {
t.Fatalf("exepcted key b, got %s", key)
t.Fatalf("expected key b, got %s", key)
}
if string(val) != "val-b" {
t.Fatalf("expected value val-b, got %s", val)
Expand All @@ -96,7 +96,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "c" {
t.Fatalf("exepcted key c, got %s", key)
t.Fatalf("expected key c, got %s", key)
}
if string(val) != "val-c" {
t.Fatalf("expected value val-c, got %s", val)
Expand All @@ -108,7 +108,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "i" {
t.Fatalf("exepcted key i, got %s", key)
t.Fatalf("expected key i, got %s", key)
}
if string(val) != "val-i" {
t.Fatalf("expected value val-i, got %s", val)
Expand All @@ -129,14 +129,14 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
}
writer.Close()

// create an isoalted reader
// create an isolated reader
reader, err := s.Reader()
if err != nil {
t.Error(err)
}
defer reader.Close()

// verify we see the value already inserted
// verify that we see the value already inserted
val, err := reader.Get([]byte("a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -182,7 +182,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
t.Errorf("expected val-b, got nil")
}

// ensure director iterator sees it
// ensure that the director iterator sees it
count = 0
it = newReader.Iterator([]byte{0})
defer it.Close()
Expand Down
2 changes: 1 addition & 1 deletion index/store/forestdb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (b *Batch) Execute() error {
defer b.store.writer.Unlock()
}

// first processed the merges
// first process the merges
for k, mc := range b.merges {
val, err := b.store.get([]byte(k))
if err != nil {
Expand Down
20 changes: 10 additions & 10 deletions index/store/forestdb/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestRollbackSameHandle(t *testing.T) {
t.Fatal(err)
}

// create 2 docs a and b
// create 2 docs, a and b
err = writer.Set([]byte("a"), []byte("val-a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestRollbackSameHandle(t *testing.T) {
}

// TestRollbackNewHandle tries to rollback the
// database, then open a new handle, and ensure
// database, then opens a new handle, and ensures
// that the rollback is reflected there as well
func TestRollbackNewHandle(t *testing.T) {
defer os.RemoveAll("test")
Expand All @@ -140,7 +140,7 @@ func TestRollbackNewHandle(t *testing.T) {
t.Fatal(err)
}

// create 2 docs a and b
// create 2 docs, a and b
err = writer.Set([]byte("a"), []byte("val-a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestRollbackNewHandle(t *testing.T) {
}

// TestRollbackOtherHandle tries to create 2 handles
// at the begining, then rollback one of them
// at the beginning, then rollback one of them
// and ensure it affects the other
func TestRollbackOtherHandle(t *testing.T) {
defer os.RemoveAll("test")
Expand All @@ -234,7 +234,7 @@ func TestRollbackOtherHandle(t *testing.T) {
t.Fatal(err)
}

// create 2 docs a and b
// create 2 docs, a and b
err = writer.Set([]byte("a"), []byte("val-a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -344,7 +344,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "b" {
t.Fatalf("exepcted key b, got %s", key)
t.Fatalf("expected key b, got %s", key)
}
if string(val) != "val-b" {
t.Fatalf("expected value val-b, got %s", val)
Expand All @@ -356,7 +356,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "c" {
t.Fatalf("exepcted key c, got %s", key)
t.Fatalf("expected key c, got %s", key)
}
if string(val) != "val-c" {
t.Fatalf("expected value val-c, got %s", val)
Expand All @@ -368,7 +368,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "i" {
t.Fatalf("exepcted key i, got %s", key)
t.Fatalf("expected key i, got %s", key)
}
if string(val) != "val-i" {
t.Fatalf("expected value val-i, got %s", val)
Expand All @@ -389,7 +389,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
}
writer.Close()

// create an isoalted reader
// create an isolated reader
reader, err := s.Reader()
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -442,7 +442,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
t.Errorf("expected val-b, got nil")
}

// ensure director iterator sees it
// ensure that the director iterator sees it
count = 0
it = newReader.Iterator([]byte{0})
defer it.Close()
Expand Down
2 changes: 1 addition & 1 deletion index/store/inmem/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (i *Batch) Execute() error {
defer i.store.writer.Unlock()
}

// first processed the merges
// first process the merges
for k, mc := range i.merges {
val, err := i.store.get([]byte(k))
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions index/store/inmem/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "b" {
t.Fatalf("exepcted key b, got %s", key)
t.Fatalf("expected key b, got %s", key)
}
if string(val) != "val-b" {
t.Fatalf("expected value val-b, got %s", val)
Expand All @@ -85,7 +85,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "c" {
t.Fatalf("exepcted key c, got %s", key)
t.Fatalf("expected key c, got %s", key)
}
if string(val) != "val-c" {
t.Fatalf("expected value val-c, got %s", val)
Expand All @@ -97,7 +97,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "i" {
t.Fatalf("exepcted key i, got %s", key)
t.Fatalf("expected key i, got %s", key)
}
if string(val) != "val-i" {
t.Fatalf("expected value val-i, got %s", val)
Expand All @@ -118,14 +118,14 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
}
writer.Close()

// create an isoalted reader
// create an isolated reader
reader, err := s.Reader()
if err != nil {
t.Error(err)
}
defer reader.Close()

// verify we see the value already inserted
// verify that we see the value already inserted
val, err := reader.Get([]byte("a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -171,7 +171,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
t.Errorf("expected val-b, got nil")
}

// ensure director iterator sees it
// ensure that the director iterator sees it
count = 0
it = newReader.Iterator([]byte{0})
defer it.Close()
Expand Down
2 changes: 1 addition & 1 deletion index/store/leveldb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (ldb *Batch) Execute() error {
batch := levigo.NewWriteBatch()
defer batch.Close()

// first processed the merges
// first process the merges
for k, mc := range ldb.merges {
val, err := ldb.store.get([]byte(k))
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions index/store/leveldb/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "b" {
t.Fatalf("exepcted key b, got %s", key)
t.Fatalf("expected key b, got %s", key)
}
if string(val) != "val-b" {
t.Fatalf("expected value val-b, got %s", val)
Expand All @@ -102,7 +102,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "c" {
t.Fatalf("exepcted key c, got %s", key)
t.Fatalf("expected key c, got %s", key)
}
if string(val) != "val-c" {
t.Fatalf("expected value val-c, got %s", val)
Expand All @@ -114,7 +114,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid false, expected true")
}
if string(key) != "i" {
t.Fatalf("exepcted key i, got %s", key)
t.Fatalf("expected key i, got %s", key)
}
if string(val) != "val-i" {
t.Fatalf("expected value val-i, got %s", val)
Expand All @@ -135,14 +135,14 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
}
writer.Close()

// create an isoalted reader
// create an isolated reader
reader, err := s.Reader()
if err != nil {
t.Error(err)
}
defer reader.Close()

// verify we see the value already inserted
// verify that we see the value already inserted
val, err := reader.Get([]byte("a"))
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -188,7 +188,7 @@ func CommonTestReaderIsolation(t *testing.T, s store.KVStore) {
t.Errorf("expected val-b, got nil")
}

// ensure director iterator sees it
// ensure that the director iterator sees it
count = 0
it = newReader.Iterator([]byte{0})
defer it.Close()
Expand Down
2 changes: 1 addition & 1 deletion index/store/null/null_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func CommonTestKVStore(t *testing.T, s store.KVStore) {
t.Fatalf("valid true, expected false")
}
if key != nil {
t.Fatalf("exepcted key nil, got %s", key)
t.Fatalf("expected key nil, got %s", key)
}
if val != nil {
t.Fatalf("expected value nil, got %s", val)
Expand Down
2 changes: 1 addition & 1 deletion index/upside_down/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// the functions in this file are only intended to be used by
// the bleve_dump utility and the debug http handlers
// if your application relies on the, you're doing something wrong
// if your application relies on them, you're doing something wrong
// they may change or be removed at any time

func (udc *UpsideDownCouch) dumpPrefix(kvreader store.KVReader, rv chan interface{}, prefix []byte) {
Expand Down
2 changes: 1 addition & 1 deletion index/upside_down/field_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func incrementBytes(in []byte) []byte {
for i := len(rv) - 1; i >= 0; i-- {
rv[i] = rv[i] + 1
if rv[i] != 0 {
// didnt' overflow, so stop
// didn't overflow, so stop
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion index/upside_down/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestIndexReader(t *testing.T) {
}
defer indexReader.Close()

// first look for a term that doesnt exist
// first look for a term that doesn't exist
reader, err := indexReader.TermFieldReader([]byte("nope"), "name")
if err != nil {
t.Errorf("Error accessing term field reader: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion index/upside_down/row_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestInvalidRows(t *testing.T) {
[]byte{'t', 0, 0, 'b', 'e', 'e', 'r', ByteSeparator},
[]byte{},
},
// type t, invalid val (misisng freq)
// type t, invalid val (missing freq)
{
[]byte{'t', 0, 0, 'b', 'e', 'e', 'r', ByteSeparator, 'b', 'u', 'd', 'w', 'e', 'i', 's', 'e', 'r'},
[]byte{},
Expand Down
2 changes: 1 addition & 1 deletion index/upside_down/upside_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ func (udc *UpsideDownCouch) Batch(batch *index.Batch) error {
for docID, doc := range batch.IndexOps {
backIndexRow := backIndexRows[docID]
if doc == nil && backIndexRow != nil {
//delete
// delete
deleteRows = udc.deleteSingle(docID, backIndexRow, deleteRows)
docsDeleted++
} else if doc != nil {
Expand Down
Loading

0 comments on commit 59b014d

Please sign in to comment.