Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Natural-sorting/J/natural-sorting-1.j
Normal file
10
Task/Natural-sorting/J/natural-sorting-1.j
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
require'strings regex'
|
||||
|
||||
lines=: <;.2
|
||||
titleFix=: ('^\s*(the|a|an)\b';'')&rxrplc
|
||||
isNum=: e.&'0123456789'
|
||||
num=: ".^:(isNum@{.)
|
||||
split=: <@num/.~ [:+/\1,2 ~:/\ isNum
|
||||
norm=: [: split (32 9 12 13 14 15{a.) -.~ [: titleFix tolower
|
||||
|
||||
natSor=: lines ;@/: norm&.>@lines
|
||||
45
Task/Natural-sorting/J/natural-sorting-2.j
Normal file
45
Task/Natural-sorting/J/natural-sorting-2.j
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
IgnoringLeadingSpaces=:0 :0
|
||||
ignore leading spaces: 2-2
|
||||
ignore leading spaces: 2-1
|
||||
ignore leading spaces: 2+0
|
||||
ignore leading spaces: 2+1
|
||||
)
|
||||
|
||||
IgnoringMultipleAdjacentSpaces=: 0 :0
|
||||
ignore m.a.s spaces: 2-2
|
||||
ignore m.a.s spaces: 2-1
|
||||
ignore m.a.s spaces: 2+0
|
||||
ignore m.a.s spaces: 2+1
|
||||
)
|
||||
|
||||
bsSubst=: rplc&((LF;'\'),('\r';13{a.),('\x0c';12{a.),('\x0b';11{a.),('\n';LF),:'\t';TAB)
|
||||
|
||||
EquivalentWhitespaceCharacters=: bsSubst 0 :0
|
||||
Equiv. spaces: 3-3
|
||||
Equiv.\rspaces: 3-2
|
||||
Equiv.\x0cspaces: 3-1
|
||||
Equiv.\x0bspaces: 3+0
|
||||
Equiv.\nspaces: 3+1
|
||||
Equiv.\tspaces: 3+2
|
||||
)
|
||||
|
||||
CaseIndepenent=: 0 :0
|
||||
cASE INDEPENENT: 3-2
|
||||
caSE INDEPENENT: 3-1
|
||||
casE INDEPENENT: 3+0
|
||||
case INDEPENENT: 3+1
|
||||
)
|
||||
|
||||
NumericFieldsAsNumerics=: 0 :0
|
||||
foo100bar99baz0.txt
|
||||
foo100bar10baz0.txt
|
||||
foo1000bar99baz10.txt
|
||||
foo1000bar99baz9.txt
|
||||
)
|
||||
|
||||
Titles=: 0 :0
|
||||
The Wind in the Willows
|
||||
The 40th step more
|
||||
The 39 steps
|
||||
Wanda
|
||||
)
|
||||
33
Task/Natural-sorting/J/natural-sorting-3.j
Normal file
33
Task/Natural-sorting/J/natural-sorting-3.j
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
natSor IgnoringLeadingSpaces
|
||||
ignore leading spaces: 2+0
|
||||
ignore leading spaces: 2+1
|
||||
ignore leading spaces: 2-1
|
||||
ignore leading spaces: 2-2
|
||||
|
||||
natSor IgnoringMultipleAdjacentSpaces
|
||||
ignore m.a.s spaces: 2+0
|
||||
ignore m.a.s spaces: 2+1
|
||||
ignore m.a.s spaces: 2-1
|
||||
ignore m.a.s spaces: 2-2
|
||||
|
||||
natSor EquivalentWhitespaceCharacters
|
||||
Equiv.
|
||||
spaces: 3+1\ Equiv.<2E>spaces: 3+0\ Equiv. spaces: 3+2\ Equiv.<2E>spaces: 3-1\ Equiv.
|
||||
spaces: 3-2\ Equiv. spaces: 3-3\
|
||||
natSor CaseIndepenent
|
||||
casE INDEPENENT: 3+0
|
||||
case INDEPENENT: 3+1
|
||||
caSE INDEPENENT: 3-1
|
||||
cASE INDEPENENT: 3-2
|
||||
|
||||
natSor NumericFieldsAsNumerics
|
||||
foo100bar10baz0.txt
|
||||
foo100bar99baz0.txt
|
||||
foo1000bar99baz9.txt
|
||||
foo1000bar99baz10.txt
|
||||
|
||||
natSor Titles
|
||||
The 39 steps
|
||||
The 40th step more
|
||||
Wanda
|
||||
The Wind in the Willows
|
||||
Loading…
Add table
Add a link
Reference in a new issue