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
| # coding: utf-8 | |
| import chardet | |
| import datetime | |
| import html.parser | |
| import optparse | |
| import os | |
| import re | |
| import sys |
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
| # coding: utf-8 | |
| import sys | |
| import codecs | |
| import math | |
| from collections import defaultdict | |
| # calculate BLEU score between two corpus | |
| def BLEU(ws_hyp, ws_ref, **kwargs): | |
| # check args |
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
| # coding: utf-8 | |
| import codecs | |
| import sys | |
| from collections import defaultdict | |
| # calculate IBM Model 1 translation probability | |
| # params: | |
| # fname_e: <str> name of corpus file in target language | |
| # fname_f: <str> name of corpus file in foreign language |
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
| <?php | |
| /* PHPでTwitter OAuth認証を行うサンプル・プログラム | |
| * Author : お出汁 | |
| * Creation : 2010/10/12 | |
| * Update : 2013/01/21 | |
| * Version : 0.3 | |
| * Twitter API Wikiのabraham's twitteroauth 0.2.0を使わせて頂いています。 | |
| */ | |
| require_once('twitteroauth/twitteroauth.php'); |
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
| program TaketaDentaku(input, output); | |
| const KETA_MAX = 30; | |
| type su = array[0 .. KETA_MAX - 1] of integer; | |
| type kazu = record | |
| plus: Boolean; | |
| keta: integer; | |
| abs: su; | |
| end; |
NewerOlder