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
PREFIX dbo: <http://dbpedia.org/ontology/> | |
SELECT ?station, ?label, ?lat, ?long, ?location WHERE { | |
?station rdf:type <http://dbpedia.org/ontology/RailwayStation> . | |
?station <http://dbpedia.org/ontology/location> :Tokyo . | |
?station <http://dbpedia.org/ontology/location> ?location . | |
?station rdfs:label ?label . | |
?station <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat . | |
?station <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . | |
FILTER (LANG(?label) = 'ja') |
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
# Put new words in a CSV with this format | |
# 表層形,左文脈ID,右文脈ID,コスト,品詞,品詞細分類1,品詞細分類2,品詞細分類3,活用形,活用型,原形,読み,発音 | |
# surface_form,left_context_id,right_context_id,cost,part_of_speech,pos_division_1,pos_division_2,pos_division_3,inflection_type,inflection_style,lemma,reading,pronunciation | |
$ echo "fasihsignal,-1,-1,100,名詞,一般,*,*,*,*,fasihsignal,ファシシグナル,ファシシグナル" > a.csv | |
# Then use mecab-dict-index to compile the csv into a .dic file, based on an existing mecab dictionary file | |
$ /usr/local/Cellar/mecab/0.996/libexec/mecab/mecab-dict-index -d/usr/local/Cellar/mecab/0.996/lib/mecab/dic/ipadic/ -u a.dic -f utf8 -t utf8 a.csv | |
# The use it | |
$ mecab -ua.dic |
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
1: 日 | |
2: 一 | |
3: 国 | |
4: 会 | |
5: 人 | |
6: 年 | |
7: 大 | |
8: 十 | |
9: 二 | |
10: 本 |
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 ruby | |
# https://gist.github.com/jvatic/2711625 | |
flag = false | |
files = `git diff --cached --name-only --diff-filter=ACM | grep "_spec\.rb$"`.split("\n") | |
files.each do |file| | |
results = `git diff --cached #{file} | grep "^\+[^+]" | grep ":focus"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') } | |
if $? == 0 |
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 dock_position to do shell script "defaults read com.apple.dock orientation" | |
tell application "System Events" to tell process "Dock" | |
set dock_dimensions to size in list 1 | |
set dock_width to item 1 of dock_dimensions | |
set dock_height to item 2 of dock_dimensions | |
end tell | |
tell application "Finder" | |
set the_bounds to bounds of window of desktop |
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 | |
## Depending on which Perl version you're running you'll get different Unicode semantics | |
# Perl 5.18 (OSX default) - Unicode 6.2 | |
# Perl 5.24 (Latest, available through homebrew) - Unicode 8.0 | |
# Perl 5.25 (Bleeding edge, available through perlbrew) - Unicode 9.0 | |
## perlbrew allows you to easily install bleeding edge Perl: | |
# sudo /usr/bin/cpan App::perlbrew | |
# perlbrew install 5.25.9; perlbrew use 5.25.9 |
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
const HIRAGANA = "ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ"; | |
const KATAKANA = "ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ"; | |
function transliterateHiraganaToKatakana(text) { | |
var newText = ""; | |
for(let character of text) { | |
const codepoint = character.codePointAt(0); | |
if(codepoint >= 12353 && codepoint <= 12438) { |
OlderNewer