This file contains 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
# encoding: utf-8 | |
# Processor of Link Grammar for Russian output. | |
# | |
class LinkParser::Lexer | |
# This exception raises when link grammar is invalid and Lexer | |
# is unable to understand the output. | |
# | |
class InvalidLinkGrammar < RuntimeError | |
attr_reader :input |
This file contains 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 -*- | |
# This program is free software. It comes without any warranty, to | |
# the extent permitted by applicable law. You can redistribute it | |
# and/or modify it under the terms of the Do What The Fuck You Want | |
# To Public License, Version 2, as published by Sam Hocevar. See | |
# http://sam.zoy.org/wtfpl/COPYING for more details. | |
import argparse |
This file contains 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 | |
# encoding: utf-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'csv' | |
Dir.mkdir 'opencorpora' unless File.directory? 'opencorpora' | |
buf, flag = '', false |
This file contains 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 groovy | |
import org.gephi.data.attributes.api.AttributeController | |
import org.gephi.graph.api.GraphController | |
import org.gephi.io.importer.api.EdgeDefault | |
import org.gephi.io.importer.api.ImportController | |
import org.gephi.io.processor.plugin.DefaultProcessor | |
import org.gephi.project.api.ProjectController | |
import org.gephi.statistics.plugin.Degree | |
import org.openide.util.Lookup |
This file contains 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 | |
=begin | |
http://ai.stanford.edu/~chuongdo/papers/em_tutorial.pdf | |
http://stats.stackexchange.com/questions/72774/numerical-example-to-understand-expectation-maximization | |
http://math.stackexchange.com/questions/25111/how-does-expectation-maximization-work | |
http://math.stackexchange.com/questions/81004/how-does-expectation-maximization-work-in-coin-flipping-problem | |
http://www.youtube.com/watch?v=7e65vXZEv5Q | |
=end |
This file contains 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
all: clean lister latex view | |
clean: | |
latexmk -C -pdf | |
rm -f source.tex | |
lister: | |
./lister.rb | |
latex: | |
latexmk -pdf -pdflatex="xelatex %O %S" listing | |
view: | |
xdg-open listing.pdf |
This file contains 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
\documentclass[11pt]{letter} | |
\usepackage[a4paper,landscape]{geometry} | |
\usepackage{polyglossia} | |
\setmainlanguage[babelshorthands=true]{russian} | |
\setotherlanguage{english} | |
\defaultfontfeatures{Ligatures=TeX,Mapping=tex-text} |
This file contains 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 | |
require 'net/http' | |
require 'uri' | |
require 'nokogiri' | |
Example = Struct.new(:text, :source) | |
def ruscorpora(word) | |
uri = URI('http://search.ruscorpora.ru/download-xml.xml') |
This file contains 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
#!/bin/bash -e | |
S=$(head -1) | |
CHARSETS=(utf8 cp1251 cp1252 koi8r koi8u iso-8859-5 maccyrillic) | |
for c1 in ${CHARSETS[*]}; do | |
for c2 in ${CHARSETS[*]}; do | |
for c3 in ${CHARSETS[*]}; do | |
for c4 in ${CHARSETS[*]}; do | |
echo -ne "$c1\t$c2\t$c3\t$c4\t" | |
<<<$S iconv -f=$c1 -t=$c2 -c | iconv -f=$c3 -t=$c4 -c | |
done |
This file contains 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 de.tudarmstadt.ukp.jwktl.JWKTL; | |
import de.tudarmstadt.ukp.jwktl.api.filter.WiktionaryEntryFilter; | |
import de.tudarmstadt.ukp.jwktl.api.util.Language; | |
import java.io.File; | |
import java.util.Locale; | |
public class ExtractRelations { | |
public static void main(String[] args) { | |
if (args.length != 1) { | |
System.err.println("Usage: java ExtractRelations.java database [filter]"); |
OlderNewer