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 -*- | |
import sys | |
from collections import namedtuple, deque | |
from datetime import datetime | |
# We express a "state" as the locations of the seven pieces | |
# in the order of: ou, hi, kaku, kin1, kin2, gin1, gin2 | |
# with we make sure kin1 < kin2 and gin1 < gin2 to avoid duplicates |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# **************************************** | |
# VENV WRAPPER to use like conda | |
# add this to .bashrc or .bash_profile | |
# | |
# | |
# Create env: | |
# | |
# venvc <envname> | |
# | |
# Activate env: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# This works when run as a script | |
# but not when copied to a notebook cell and run it. | |
import pickle | |
from collections import namedtuple | |
# We want to embed this object into a script | |
Foo = namedtuple("Foo", "a b") | |
a = Foo(1, 2) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
""" | |
Apply JUMAN++ to many texts in parallel. | |
Requirements. | |
JUMAN++: http://nlp.ist.i.kyoto-u.ac.jp/index.php?JUMAN++ | |
Python library: | |
mojimoji (https://github.com/studio-ousia/mojimoji) or |