* optimize

This commit is contained in:
Reinhard Pointner 2012-12-02 14:16:29 +00:00
parent 9d1f33ae76
commit 7396e1fe68
2 changed files with 8 additions and 1 deletions

View File

@ -229,7 +229,8 @@ def similarity(o1, o2) {
}
List.metaClass.sortBySimilarity = { prime, Closure toStringFunction = { obj -> obj.toString() } ->
return delegate.sort{ a, b -> similarity(toStringFunction(b), prime).compareTo(similarity(toStringFunction(a), prime)) }
def simetric = new NameSimilarityMetric()
return delegate.sort{ a, b -> simetric.getSimilarity(toStringFunction(b), prime).compareTo(simetric.getSimilarity(toStringFunction(a), prime)) }
}
// call scripts

View File

@ -22,6 +22,8 @@
^Completed$
^Cover
^Crime$
^data$
^deluge$
^Documentary$
^Done$
^Download$
@ -40,7 +42,9 @@
^Movie[s]?
^new$
^other$
^private$
^Romance$
^rtorrent$
^Science.Fiction$
^Scratch$
^Season.[0-9]+
@ -50,12 +54,14 @@
^Staging$
^Storage$
^Test$
^testdata$
^Torrent[s]?
^Tracker
^Trailer
^user$
^VCD$
^VIDEO_TS$
^watch$
A.Release.Lounge
ABC
Anime[s]?