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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using CompilerLib.Syntax; | |
namespace CompilerLib.Lexical.RE { | |
class REParser { | |
private static Grammar g; |
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
def renderExample(exs: ExampleForSelection, word: WordRecord): Future[JValue] = { | |
val ex = exs.ex | |
def selected: Future[Boolean] = { | |
val res = word.reading.is.exists { rd => ex.contains(rd) } || | |
word.writing.is.exists { wr => ex.contains(wr) } | |
if (res) Promise.successful(true) | |
else { | |
val f = (root ? ParseSentence(ex)).mapTo[ParsedQuery] | |
f map (lst => { | |
lst.inner.exists { je => word.writing.is.exists { wr => je.dictForm.equals(wr) }} |
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
/* | |
* Copyright 2012 eiennohito | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
class OtherTest extends FreeSpec with ShouldMatchers { | |
"asd" - { | |
"dgs" in { | |
//BridJ.register(classOf[mecab.Tagger]) | |
val byte = Pointer.allocateByte() | |
byte.set(0.toByte) | |
val t = MecabLibrary.mecab_new2(byte) | |
val str = "私はバカです" | |
val bytes = str.getBytes("UTF-8") |
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
// Test.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <vector> | |
#include <memory> | |
#include <functional> | |
#include <type_traits> | |
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
def transformMrData(in: Iterable[JValue]) = { | |
import scalaz._ | |
import Scalaz._ | |
//val ids = (in \\ "_id"). | |
implicit val formats = DefaultFormats | |
def inner(in: JValue) = { | |
//Extraction.extract[List[HiLvl]](in) | |
val id = field[String]("_id")(in) map( new ObjectId(_) ) | |
val mp = field[Map[String, List[Double]]]("value")(in) map {o => o.map{ | |
case (i, j) => i.toInt -> j.map(_.toInt) |
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
$ = jQuery | |
module = angular.module('kotonoha', []) | |
module.directive 'tagop', -> | |
restrict: 'A' | |
require: "^taglist" | |
link: (scope, elem, attrs, taglist) -> | |
obj = scope.obj | |
inner = |
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
$ = jQuery | |
module = angular.module('taglist', []) | |
module.directive 'tagop', -> | |
restrict: 'C' | |
require: "^taglist" | |
link: (scope, elem, attrs, taglist) -> | |
obj = scope.obj | |
inner = |
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
(function() { | |
var $, module; | |
$ = jQuery; | |
module = angular.module('taglist', []); | |
module.directive('tagop', function() { | |
return { | |
restrict: 'C', |
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
$scope.tagNfo = [ | |
{ group: 'User tags', tags: [ | |
{ name: 'tag1', descr: 'tag number 1, a great tag'} | |
{ name: 'n', descr: 'Regular noun (Futsuumeishi — 普通名詞)'} | |
]}, | |
{ group: 'System tags', tags: [ | |
{ name: 'exp', descr: 'Expression'} | |
{ name: '4j', descr: 'Yojijukugo'} | |
]}, | |
{ group: "Test tags", tags: [ |