12. 排序

排序 x /: y 依據 y的 分級 /:y 重新編排 x 的順序:
   x=: 2 7 1 8 [ y=: 1 7 3 2
   (/:y);((/:y){x);(x/:y);(x/:x)
+-------+-------+-------+-------+
|0 3 2 1|2 8 1 7|2 8 1 7|1 2 7 8|
+-------+-------+-------+-------+
文字的分級與排序基於字母 a. 的排序。 例如,"text"為英文句 For example, if the name "text" is used for the present sentence (up to and including the colon), then:
   tdw=: >dwds=: ~. wds=: ;: text
   ($tdw),($dwds),($wds),($text)
21 9 21 25 103

   ]alph=: a. {~ ,(i. 26) +/ (a.i.'aA')
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

   tdw; (tdw /: tdw);(tdw/: alph i. tdw)
+---------+---------+---------+
|For      |"        |and      |
|example  |(        |colon    |
|,        |)        |example  |
|if       |,        |for      |
|the      |For      |For      |
|name     |and      |if       |
|"        |colon    |including|
|text     |example  |is       |
|is       |for      |name     |
|used     |if       |present  |
|for      |including|sentence |
|present  |is       |text     |
|sentence |name     |then:    |
|(        |present  |the      |
|up       |sentence |to       |
|to       |text     |up       |
|and      |the      |used     |
|including|then:    |,        |
|colon    |to       |"        |
|)        |up       |(        |
|then:    |used     |)        |
+---------+---------+---------+
中間欄為各個字的排序表,  "for"與"For" 隔的很開(因為 在字母 a.中大小寫不同),但是在最後一行索引表排序中, 它們又因為適當的字母索引而連接在一起。


下個前個字彙索引主選單