[JavaScript] 自然言語アルゴリズムで配列をソート
JavaScriptで自然言語アルゴリズムによるソートを実装する。
gist: 660141 - (natsort.js) - GitHub
https://gist.github.com/660141
think49
@think49
@think49 HTMLソースを読まないと確認できないが、function checkNatsort によって http://sourcefrog.net/projects/natsort/ で紹介されているソートサンプルをソート実行→確認している。
2010-11-04 00:16:33
think49
@think49
@think49 期待通りにソートされれば、"all clear!"。期待通りでなければ、"error: ["1.001", "1.1", ...]" をコンソールに出力する。
2010-11-04 00:17:00
think49
@think49
natsort.js を更新。(@version 1.0.1) MITライセンスにして、引数が Object 型でなければ TypeError を投げるようにした。 https://gist.github.com/660141 #ECMAScript
2011-03-26 18:47:03
think49
@think49
typeof array.sort !== function は UA のJavaScriptエンジンが "TypeError: array.sort is not a function" を返してくれるので検査していない。
2011-03-26 18:48:14