Skip to content

Commit

Permalink
Merge branch 'YouROK:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-aml authored Apr 13, 2023
2 parents cff1783 + b344405 commit 6a5aba6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
41 changes: 5 additions & 36 deletions db/torrsearch/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,42 +57,11 @@ func replaceChars(word string) string {

func isStopWord(word string) bool {
switch word {
case "a", "about", "above", "after", "again", "against", "all", "am", "an",
"and", "any", "are", "as", "at", "be", "because", "been", "before",
"being", "below", "between", "both", "but", "by", "can", "did", "do",
"does", "doing", "don", "down", "during", "each", "few", "for", "from",
"further", "had", "has", "have", "having", "he", "her", "here", "hers",
"herself", "him", "himself", "his", "how", "i", "if", "in", "into", "is",
"it", "its", "itself", "just", "me", "more", "most", "my", "myself",
"no", "nor", "not", "now", "of", "off", "on", "once", "only", "or",
"other", "our", "ours", "ourselves", "out", "over", "own", "s", "same",
"she", "should", "so", "some", "such", "t", "than", "that", "the", "their",
"theirs", "them", "themselves", "then", "there", "these", "they",
"this", "those", "through", "to", "too", "under", "until", "up",
"very", "was", "we", "were", "what", "when", "where", "which", "while",
"who", "whom", "why", "will", "with", "you", "your", "yours", "yourself",
"yourselves", "и", "в", "во", "не", "что", "он", "на", "я", "с",
"со", "как", "а", "то", "все", "она", "так", "его",
"но", "да", "ты", "к", "у", "же", "вы", "за", "бы",
"по", "только", "ее", "мне", "было", "вот", "от",
"меня", "еще", "нет", "о", "из", "ему", "теперь",
"когда", "даже", "ну", "вдруг", "ли", "если", "уже",
"или", "ни", "быть", "был", "него", "до", "вас",
"нибудь", "опять", "уж", "вам", "ведь", "там", "потом",
"себя", "ничего", "ей", "может", "они", "тут", "где",
"есть", "надо", "ней", "для", "мы", "тебя", "их",
"чем", "была", "сам", "чтоб", "без", "будто", "чего",
"раз", "тоже", "себе", "под", "будет", "ж", "тогда",
"кто", "этот", "того", "потому", "этого", "какой",
"совсем", "ним", "здесь", "этом", "один", "почти",
"мой", "тем", "чтобы", "нее", "сейчас", "были", "куда",
"зачем", "всех", "никогда", "можно", "при", "наконец",
"два", "об", "другой", "хоть", "после", "над", "больше",
"тот", "через", "эти", "нас", "про", "всего", "них",
"какая", "много", "разве", "три", "эту", "моя",
"впрочем", "хорошо", "свою", "этой", "перед", "иногда",
"лучше", "чуть", "том", "нельзя", "такой", "им", "более",
"всегда", "конечно", "всю", "между":
case "a", "am", "an", "and", "are", "as", "at", "be",
"by", "did", "do", "is", "of", "or", "s", "so", "t",
"и", "в", "с", "со", "а", "но", "к", "у",
"же", "бы", "по", "от", "о", "из", "ну",
"ли", "ни", "нибудь", "уж", "ведь", "ж", "об":
return true
}
return false
Expand Down
2 changes: 0 additions & 2 deletions db/torrsearch/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package torrsearch

import (
"NUMParser/db/models"
"log"
)

// Index is an inverted Index. It maps tokens to document IDs.
Expand All @@ -11,7 +10,6 @@ type Index map[string][]int
var idx Index

func NewIndex(torrs []*models.TorrentDetails) {
log.Println("Index torrs")
idx = make(Index)
idx.add(torrs)
}
Expand Down
2 changes: 1 addition & 1 deletion db/torrsearch/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ func analyze(text string) []string {
tokens := tokenize(text)
tokens = lowercaseFilter(tokens)
tokens = stopwordFilter(tokens)
tokens = stemmerFilter(tokens)
// tokens = stemmerFilter(tokens)
return tokens
}

0 comments on commit 6a5aba6

Please sign in to comment.