I'm giving up
On Monday, 16 June 2014 at 16:49:46 UTC, Andrew Brown wrote:
Sorry, comments split over two lines, this should work:
import std.stdio, std.array, std.string; //need to import
std.array
void main() {
ulong[string] dictionary; // the length property is ulong,
not
uint
foreach (line; stdin.byLine()) {
foreach (word; splitter(strip(line))) {
if (word in dictionary) continue;
auto newID = dictionary.length; //dictionarys need
immutable keys, you // can create this with .idup
dictionary[word.idup] = newID;
writeln(newID, '\t', word);
}
}
}