frhyme

guess the last phonemes of a French word (local mirror of https://gitlab.com/a3nm/frhyme)
git clone https://a3nm.net/git/frhyme/
Log | Files | Refs | README | LICENSE

commit 43512193dc0351a29b61800e133e28793c16e1e2
parent d0ef73f5cc6e0221dc6c90f84b5af43a46dac781
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 17 Aug 2019 18:25:54 +0200

remove lexique scripts -- moved to a3nm.net/git/lexique

Diffstat:
scripts/lexique/lexique_fix.sh | 8--------
scripts/lexique/lexique_prepare.sh | 6------
scripts/lexique/lexique_retrieve.sh | 12------------
scripts/lexique/subst.pl | 38--------------------------------------
4 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/scripts/lexique/lexique_fix.sh b/scripts/lexique/lexique_fix.sh @@ -1,8 +0,0 @@ -#!/bin/bash - -# General fixes for lexique - -cd "$( dirname "$0" )" - -sed 1d | ./subst.pl - diff --git a/scripts/lexique/lexique_prepare.sh b/scripts/lexique/lexique_prepare.sh @@ -1,6 +0,0 @@ -#!/bin/bash - -# Prepare the Lexique file for use with frhyme - -cut -f 1,2 | uniq - diff --git a/scripts/lexique/lexique_retrieve.sh b/scripts/lexique/lexique_retrieve.sh @@ -1,12 +0,0 @@ -#!/bin/bash - -ZIP="Lexique382.zip" -URL="http://www.lexique.org/databases/Lexique382/$ZIP" -FILE="Lexique382.tsv" - -cd "$( dirname "$0" )" - -wget $URL -unzip -qq $ZIP $FILE -cat $FILE | ./lexique_fix.sh | ./lexique_prepare.sh - diff --git a/scripts/lexique/subst.pl b/scripts/lexique/subst.pl @@ -1,38 +0,0 @@ -#!/usr/bin/perl - -# This file fixes Lexique's pronunciation info from the home-grown -# format described in -# http://www.lexique.org/outils/Manuel_Lexique.htm#_Toc108519023 to a -# variation of the X-SAMPA standard - - -sub subst { - my $a = shift; - # substitutions to apply - my @s = ( - ['§', '$'], - ['@', '#'], - ['1', '('], - ['5', ')'], - ['°', '@'], - ['3', '@'], - ['H', '8'], - ['N', 'J'], - ['G', 'N'], - ); - foreach my $t (@s) { - $a =~ s/${$t}[0]/${$t}[1]/g - } - return $a; -} - -while (<>) { - chop; - if (/^([^\t]*)\t([^\t]*)(.*)$/) { - my $repl = subst $2; - print "$1\t$repl$3\n"; - } else { - die "Cannot process line: $_\n"; - } -} -