Add tags

Add tags to the following comment

普通に解いてみました(294 bytes)。ファイル名を引数で与えます。

ハッシュテーブルのままだと分からないので最後に alist に変換して出力しています。また、大文字小文字は無視して、かつインデックスのリストを作るときに同一行番号が重複することは避けています。

実行例:

% gosh gpl.txt
... 略 ...
1
(use util.list)(use srfi-13)(let1 t(hash-table'equal?)(call-with-input-file(car *argv*)(#0=lambda(i)(port-fold(#0#(s n)(for-each(#0#(w)(hash-table-update! t(string-downcase w)(#0#(l)(if(memq n l)l(cons n l)))'()))(string-split s #[\W]))(+ n 1))1(cut read-line i))))(print(hash-table->alist t)))

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...