This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bayesian Inference with Tears | |
| # This is some simple code that I made from the Italian/Japanese food example | |
| # at the end of http://www.isi.edu/natural-language/people/bayes-with-tears.pdf | |
| import random | |
| counts = { | |
| "japanese" : 0, | |
| "italian" : 1, # Force the first day to be Italian | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| # Play with different concentrations | |
| for concentration in [0.0, 0.5, 1.0]: | |
| # First customer always sits at the first table | |
| # To do otherwise would be insanity | |
| tables = [1] | |
| # n=1 is the first customer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| entry: { | |
| korean: '먹다', | |
| pronunciation: '먹다', // fill programmatically | |
| hanja: '食', // Differentiate between yet-to-be-filled and explicitly NO hanja, it's a Korean/non-Chinese word | |
| difficulty: 4, // int | |
| frequency: 24, // should be a relative number, NOT a rank, as zipf distribution of words makes rank meaningless | |
| definitions: { | |
| english: [ | |
| 'to eat', // Should Verbs in English have "to" prefix? | |
| 'to drink' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| _id : 52512451, | |
| changes: { | |
| before: { | |
| 1234567: { "korean.word": "", "pos": 1 }, | |
| 1234568: { "definitions.english": "chees" } | |
| }, | |
| after: { | |
| 1234567: { "korean.word": "음악", "pos": 2 }, | |
| 1234568: { "definitions.english": "cheese" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| _id : 52512451, | |
| changes: { | |
| 1234567: { "korean.word": "음악", "pos": 2 }, | |
| 1234568: { "definitions.english": "cheese" } | |
| }, | |
| user: 1232141, | |
| created_at: time | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # grep :) | |
| people = ['poopy', 'jim', 'sarah', 'poopsmith', 'aki'] | |
| friends = (person for person in people when !person.match(/poop/)) | |
| alert friends |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature("Creating a User") | |
| .scenario("Create a User via Form") | |
| .given "the server is running", -> | |
| server.ready @callback | |
| .and "the DB is popuplated", -> | |
| setupFixtures @callback | |
| .when "I visit the form at user/new", -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./mongoimport --file ~/ribes/ntcir-min.json -c ej --drop | |
| connected to: 127.0.0.1 | |
| dropping: test.ej | |
| imported 3 objects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./mongo | |
| MongoDB shell version: 2.0.0 | |
| connecting to: test | |
| > db | |
| test | |
| > db.ej.count() | |
| 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "NICT-ATR" : { "A" : { "adequacy" : 3, "fluency" : 4 }, "B" : { "adequacy" : 3, "fluency" : 3 }, "C" : { "adequacy" : 4, "fluency" : 2 }, "output" : "図12を参照して、本発明の第三実施例に説明説明次に、。" }, "NTT" : { "A" : { "adequacy" : 5, "fluency" : 5 }, "B" : { "adequacy" : 5, "fluency" : 5 }, "C" : { "adequacy" : 5, "fluency" : 5 }, "output" : "次に、 図 12 を参照して、 本発明の第 3 の実施例について説明する。" }, "_id" : { "$oid" : "4ed3428a7f7130fdf093a41d" }, "english" : "Next, explanation will be given on a third embodiment of the present invention, by referring to FIG. 12.", "id" : "20000523-155948-EMBODIMENTS-73", "kuro" : { "A" : { "adequacy" : 5, "fluency" : 5 }, "B" : { "adequacy" : 5, "fluency" : 5 }, "C" : { "adequacy" : 5, "fluency" : 5 }, "output" : "次に、本発明の第3の実施例について12図である参照して説明する。" }, "moses" : { "A" : { "adequacy" : 5, "fluency" : 5 }, "B" : { "adequacy" : 5, "fluency" : 5 }, "C" : { "adequacy" : 5, "fluency" : 5 }, "output" : "次に 、 図 12 を 参照 し て 、 本 発明 の 第 3 実施 例 について 説明 する 。 " }, "ref" : "次に、本発明の第3実施例を図12用いて説明する。", "tsbmt" : { "A" : { "a |