Doge Decimal Classification
Such classification. Many library. So fun. No Dewey. Wow.
npm i dogedc
Doge Decimal Classification now comes with a command-line interface! Amaze.
$ dogedc 123So determinism. Many indeterminism.$ dogedc # random classVery international. Many law. Wow.
You'll need to install it globally (
npm i dogedc -g) to get the CLI on your path.
dogedc(classNumber, callback) — convert class from boring old Dewey Decimal Classification to exciting new Doge Decimal Classification. The callback function is passed any error as its first argument & an object as its second argument, that object has form:
'classNumber': '020''className': 'Library & information sciences''dogeClassName': 'Many library. Such information. Very sciences.'
classNumber is falsey or not present,
dogedc will pick a random class number & pass that to the callback.
var dogedc = require'dogedc';// get random Doge Decimal classdogedcconsole.log'Class number:' ddcclassNumber;console.log'Doge class name:' ddcdogeClassName;;// look up 020's class namedogedc'020'console.log'020' ddcdogeClassName;;
The dogedc node module also exposes a
toDoge function for converting tepid plain human speak into awesome beautiful doge speak. It was written specifically for this module, so as a general-purpose doge-ifier your mileage may vary, but it's there.
var toDoge = require'dogedc'toDoge;console.logtoDoge'Hello World';// logs "Many hello. Much world." or some such
number argument passed to
020 === 16);
Right now, only top-level, 3-digit classes work.
I culled the list of Dewey Decimal Classes from the University of Illinois at Urbana-Champaign's list. If there are any errors, blame them ;)
Doge Decimal Classification is the first stochastic classification system.* Class names are randomly generated based on the corresponding Dewey Decimal Classification & well-recognized dogespeak constructions. For this module's users, that means that the resulting
dogeClassName of any given class number may differ each time the module is executed.
I tried using
fs.createReadStream & JSONStream to parse the Dewey JSON file but it turned out to be almost twice as slow as simply using
fs.readFile. That work is on the
stream branch & the testing script is at test/bench.
*…that I'm aware of.