Skip to content

Instantly share code, notes, and snippets.

@naoh16
naoh16 / example-julius-adin-send.py
Created February 3, 2021 09:53
Example script for Julius Adinnet sender for WAV file
#!env python
import wave
import socket
from struct import pack
import time
adinnet_hostname = 'localhost'
adinnet_port = 5530
wav_filename = 'tmp.wav'
#!/bin/bash
#
# Document rendering tool with 'upLaTeX' on EDUSYS environment
#
# rev.5 S. Hara, 2022.07.16 * Print parts of errors/warnings
# rev.4 S. Hara, 2022.06.16 * fix bug related log files
# rev.3 S. Hara, 2022.03.23 * platex --> uplatex
# rev.2 S. Hara, 2019.01.21 * bash version
# rev.1 N. Watanabe, 2013.12.19 * csh version
#
@naoh16
naoh16 / edu-reportcheck-level2.py
Last active January 11, 2019 02:05
Simple latex report checker: Level 2
#!env python
# -*- coding: utf-8 -*-
'''Edu report checker: Level 2
形態素解析も行いながら,発展的な内容もチェックしています.
Message Examples
-------------------
- [LV2-1-1] 1段落に{:d}単語含まれています.多くとも 600 単語以下となるよう,文や段落の構成を考え直してみましょう.
@naoh16
naoh16 / edu-reportcheck-level1.py
Last active January 11, 2019 02:03
Simple latex report checker: Level 1
#!env python
# -*- coding: utf-8 -*-
'''Edu report checker: Level 1
主にLaTeXの使い方のミスに起因するような,機械的に見つけられるレベルの問題を指摘しています.
Message Examples
-------------------
- [LV1-1-1] 全角句点には「.」を使いましょう.
@naoh16
naoh16 / arayuru.m
Last active November 4, 2020 10:25
Audio Recording tool for MATLAB/Octave
%ARAYURU(vargin)
% This is very simple audio recording tool. You can extract short audio
% segment by mouse clicking (right-click, then select 'save' menu).
%<OPTIONS>
% varname : Variable name for segments (DEFAULT: 'arayuru_segments')
% sampling_rate : Sampling rate of audio (DEFAULT: 16000 [Hz])
% record_len : Length of recording window (DEFAULT: 2.0 [sec])
% segment_len : Length of segmentation window (DEFAULT: 0.6 [sec])
%<USAGE>
% arayuru('varname', 'mydata');
@naoh16
naoh16 / conv_gmm_htk2sptk.pl
Created February 20, 2017 04:28
HTKで作ったGMM(中心1状態のHMM)をSPTKで読み込める形式に変換するスクリプト
#!env perl
use strict;
use warnings;
use Getopt::Long;
my $opt_outdir = ".";
GetOptions('dir=s' => \$opt_outdir);
my @mixtures = ();
@naoh16
naoh16 / mkdfa.py
Last active January 25, 2019 10:20
# -*- coding: utf-8 -*-
"""
mkdfa.py
Implementation of mkdfa.pl for python 3
Copyright (c) 2019 Sunao Hara.
 This script is released under the MIT license.
https://opensource.org/licenses/mit-license.php
"""
@naoh16
naoh16 / plot_GraphA.m
Last active October 7, 2020 14:33
情報工学実験B グラフ描画の例
% Example of Graph A
A = [0 1 1 0 0;
1 0 0 0 0;
1 0 0 1 1;
0 0 1 0 0;
0 0 1 0 0
];
initial_node = 1;
target_node = 5;
@naoh16
naoh16 / maze_convert.m
Last active November 5, 2020 08:57
情報工学実験B(人工知能実験)の迷路作成用スクリプト
function maze_st = maze_convert(maze)
% MAZE_CONVERT Convert from a map to Adjacency matrix
% maze_st = MAZE_CONVERT(maze)
% ARGS
% maze Maze matrix
% RETURN
% maze_st.A Adjacency Matrix
% maze_st.initial_node Initial node
% maze_st.target_node Target node
% maze_st.xy xy for gplot
@naoh16
naoh16 / fstdm_example.py
Last active October 3, 2016 06:30
Example of Dialog Management using Finite State Transducer (FST)
# -*- coding: utf-8 -*-
"""
Example of Dialog Management using Finite State Transducer (FST)
"""
import csv
from collections import deque
##
## Load FST file