add title sort for use with joe's mp3 player
parent
ed6da6b18c
commit
73a2fa49c5
|
@ -0,0 +1 @@
|
|||
Doug Coleman
|
|
@ -0,0 +1,40 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: tools.test sorting.title ;
|
||||
IN: sorting.title.tests
|
||||
|
||||
: sort-me ( -- seq )
|
||||
{
|
||||
"The Beatles"
|
||||
"A river runs through it"
|
||||
"Another"
|
||||
"la vida loca"
|
||||
"Basketball"
|
||||
"racquetball"
|
||||
"Los Fujis"
|
||||
"los Fujis"
|
||||
"La cucaracha"
|
||||
"a day to remember"
|
||||
"of mice and men"
|
||||
"on belay"
|
||||
"for the horde"
|
||||
} ;
|
||||
[
|
||||
{
|
||||
"Another"
|
||||
"Basketball"
|
||||
"The Beatles"
|
||||
"La cucaracha"
|
||||
"a day to remember"
|
||||
"for the horde"
|
||||
"Los Fujis"
|
||||
"los Fujis"
|
||||
"of mice and men"
|
||||
"on belay"
|
||||
"racquetball"
|
||||
"A river runs through it"
|
||||
"la vida loca"
|
||||
}
|
||||
] [
|
||||
sort-me title-sort
|
||||
] unit-test
|
|
@ -0,0 +1,7 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: sorting.functor regexp kernel accessors sequences
|
||||
unicode.case ;
|
||||
IN: sorting.title
|
||||
|
||||
<< "title" [ >lower dup R/ ^(the|a|an|el|la|los|las|il) / first-match [ to>> tail-slice ] when* ] define-sorting >>
|
Loading…
Reference in New Issue