frhyme

guess the last phonemes of a French word
git clone https://a3nm.net/git/frhyme/
Log | Files | Refs | README

README (3090B)


      1 frhyme -- a toolkit to guess the last phonemes of a French word
      2 Copyright (C) 2011-2012 by Antoine Amarilli
      3 
      4 == 0. Licence ==
      5 
      6 Permission is hereby granted, free of charge, to any person obtaining a
      7 copy of this software and associated documentation files (the
      8 "Software"), to deal in the Software without restriction, including
      9 without limitation the rights to use, copy, modify, merge, publish,
     10 distribute, sublicense, and/or sell copies of the Software, and to
     11 permit persons to whom the Software is furnished to do so, subject to
     12 the following conditions:
     13 
     14 The above copyright notice and this permission notice shall be included
     15 in all copies or substantial portions of the Software.
     16 
     17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     18 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     20 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     22 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     23 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     24 
     25 == 1. Features ==
     26 
     27 frhyme is a tool to guess what the last phonemes of a French word are.
     28 It is trained on a list of words with associated pronunciation, and will
     29 infer a few likely possibilities for unseen words using known words with
     30 the longest common prefix, using a trie for internal representation.
     31 
     32 == 2. Usage ==
     33 
     34 To avoid licensing headaches, and because the data file is quite big, no
     35 pronunciation data is included, you have to generate it yourself. See section 3.
     36 
     37 Once you have pronunciation data ready in frhyme.json, you can either run
     38 frhyme.py [NBEST], giving one word per line in stdin and getting the NBEST top
     39 pronunciations on stdout (default is 5), or you can import it in a Python file
     40 and call frhyme.lookup(word, NBEST) which returns the NBEST top pronunciations
     41 (default is 5).
     42 
     43 The pronunciations returned are annotated with a confidence score (the number of
     44 occurrences in the training data). They should be sensible up to the longest
     45 prefix occurring in the training data, but may be prefixed by garbage.
     46 
     47 == 3. Training ==
     48 
     49 First, make sure that you have a working python3 installation and that you have
     50 unzip (Debian packages: python3, unzip).
     51 
     52 The data used by frhyme.py is loaded at runtime from the fryme.json file which
     53 should be trained from a pronunciation database. The recommended way to do so is
     54 to use a tweaked Lexique <http://lexique.org> along with a provided bugfix file,
     55 as follows:
     56 
     57   lexique/lexique_retrieve.sh > lexique.txt
     58   ./make.sh NPHON lexique.txt additions > frhyme.json
     59 
     60 where NPHON is the number of trailing phonemes to keep (suggested value: 4).
     61 Beware, this may take up several hundred megabytes of RAM. The resulting file
     62 should be accurate on the French words of Lexique, and will return
     63 pronunciations in a variant of X-SAMPA which ensures that each phoneme is mapped
     64 to exactly one ASCII character: the substitutions are "A~" => "#", "O~" => "$",
     65 "E~" => ")", "9~" => "(".
     66