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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import re | |
| import datetime | |
| pattern = ur'電力.*供給' | |
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
| #!/usr/bin/python | |
| # A python implementation of the string rewriting kernel | |
| # by Graham Neubig | |
| # | |
| # Reference: | |
| # Fan Bu, Hang Li, Xiaoyan Zhu. "String Rewriting Kernel". ACL 2012 | |
| # http://aclweb.org/anthology-new/P/P12/P12-1047.pdf | |
| from math import factorial |
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
| #!/usr/bin/perl | |
| # This is a script to change KyTea's POS tags in Japanese to English | |
| # abbreviations | |
| use strict; | |
| use utf8; | |
| use Getopt::Long; | |
| use List::Util qw(sum min max shuffle); | |
| binmode STDIN, ":utf8"; | |
| binmode STDOUT, ":utf8"; |
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
| #include <vector> | |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <cmath> | |
| using namespace std; | |
| int SampleMultinomial(const vector<double> & distribution) { | |
| double value = (double)rand()/RAND_MAX; | |
| for(int i = 0; i < distribution.size(); i++) |
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
| #!/usr/bin/python | |
| from nltk.tree import Tree | |
| import sys | |
| # A program to display parse trees (in Penn treebank format) with NLTK | |
| # | |
| # To install NLTK on ubuntu: sudo apt-get install python-nltk | |
| for line in sys.stdin: |
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
| set.seed(123141) | |
| fcount <- 20 | |
| tcount <- 1 | |
| alpha <- 3 | |
| xf <- rnorm(fcount,mean=-1, sd=0.7) | |
| xt <- rnorm(tcount,mean=1, sd=0.7) | |
| yf <- mat.or.vec(fcount,1) | |
| yt <- mat.or.vec(tcount,1) |
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
| #!/usr/bin/perl | |
| use strict; | |
| use utf8; | |
| use List::Util qw(max min); | |
| binmode STDIN, ":utf8"; | |
| binmode STDOUT, ":utf8"; | |
| if(@ARGV != 2) { | |
| print STDERR "Usage: counterrors.pl REFERENCE SYSTEM\n"; |
NewerOlder