* 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() } -> 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 // call scripts

View File

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