FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssb22/gradint
  • st822/gradint
2 results
Show changes
Commits on Source (255)
Showing with 1457 additions and 128 deletions
*~
__pycache__
This diff is collapsed.
This diff is collapsed.
File moved
File moved
File moved
......@@ -3,7 +3,8 @@ gradint build instructions
See Makefile for what you can do.
As a GPL program, gradint can include parts of other GPL programs.
See README-license.txt for licensing notes (and for a note on why the
Mac and Windows bundles cannot be upgraded to eSpeak-NG)
You will need 7-Zip for making the Windows version
(so you'll need to be running on x86 Linux or Cygwin).
......@@ -12,9 +13,9 @@ windows/7zS.sfx is the stub for 7-zip self-extracting files
updated versions still work with gradint's 7zip setup file). 7zip is LGPL.
windows/gradint contains quite a few files that were output by compiling an
earlier version of gradint on py2exe under python2.3 (both of which are GPL)
on a Windows box. Those files are: datetime.pyd _sre.pyd w9xpopen.exe
winsound.pyd library.zip gradint-wrapper.exe python23.dll. In order to
earlier version of gradint on py2exe under python2.3 on a Windows box.
Those files are: datetime.pyd _sre.pyd w9xpopen.exe winsound.pyd
ibrary.zip gradint-wrapper.exe python23.dll. In order to
avoid having to use a Windows box with py2exe every time (and note py2exe
with Python 2.5 requires Administrator access to the Windows system to
install, so it's no good running that in an average university login
......@@ -29,23 +30,20 @@ and using only the libraries provided in that library.zip file. (It can
attempt to import other libraries, but it must have a fall-back mechanism if
they're not there, as they almost certainly won't be there on Windows.)
windows/ also contains a copy of ptts.exe (extracted from Jampal from
jampal.sourceforge.net with is GPL) and madplay.exe (I can't remember how I
got this binary but I know madplay is GPL).
The Windows setup will install to Program Files\gradint on Windows 9x and
%HomePath%\gradint on later versions. The start menu and desktop
"shortcuts" are all batch-file hacks because I haven't made a "real" Windows
%installer, but it should be OK on most systems.
start-gradint.app contains the Mac files. It has a binary of qtplay which
is redistributable (see qtplay.copyright), and also a Finder script that
start-gradint.app contains the Mac files. It has a Finder script that
starts gradint.py in a Terminal.
(qtplay is compiled for PowerPC; Intel macs should automatically use the
emulator.)
riscos.zip contains a copy of !PlayIt (which is re-distributable) and a
riscos.zip contains a copy of !PlayIt, which is re-distributable on a
"no commercial use" license. If that were combined with Gradint then
) and a
compiled version of the Wenhua binary (which is GPL and related to gradint -
see vocab.txt). It's important not to re-create riscos.zip except by using
a RISCOS-aware zip program (such as on RISC OS itself) otherwise the RISC OS
......
Licensing notes
---------------
As a GPL program, Gradint can include parts of other GPL programs.
It is possible that many of these programs could be included anyway
even if Gradint were not GPL, since they are optional and are run as
system commands independently of the Gradint process: this seems to
fit the "mere aggregation" clause of the GPL. However, Gradint's use
of eSpeak may be a 'borderline' case, as may be the Windows version's
use of py2exe, so I feel the safest thing is to make Gradint GPL too.
I could make a more liberally licensed version of the Gradint core
code without the parts that drive eSpeak etc. This liberally-licensed
core code would then be includeable in the whole GPL version and also
in other non-GPL projects. To keep things simple, I have not made
such a division by default (the Gradint GUI displays "GPL" because
it's usually associated with eSpeak, and to save screen space I don't
want to change that to "whole thing's GPL but some parts are Apache"),
but contact me if you need me to make or approve a cut-down version of
the code containing just the parts that don't have to be GPL, probably
as a separate project.
The GPL allows commercial use, and it does not allow the removal of
any permissions it grants, including the permission for commercial
use. Therefore, it is NOT allowed to take a GPL program together with
a program that's distributed under a "non-commercial use only" license
and distribute the combined version, unless it falls under the GPL's
provision of "mere aggregation". (I could give special permission,
but my permission would not be valid if the above "borderline" cases
really do mean that Gradint must be GPL with no extra permissions.)
The Windows and Mac versions of Gradint include not only eSpeak but
also some customised dictionary files, one of which contains
pronunciation data derived from the OALD with a "non-commercial only"
license. Since eSpeak's dictionary is a user-customisable file loaded
at runtime, and does not make up part of eSpeak's code proper, it is
arguable that making a non-commercial download of eSpeak + OALD is
"mere aggregation" allowed by the GPL. However, there is also the
issue that this modified dictionary was derived not only from the OALD
but also from eSpeak's original data files, including en_rules which
is explicitly GPL, so I would need special permission to combine this
with OALD in a non-commercial binary (otherwise I would have to ship
the files separately and have eSpeak combine them at runtime).
Thankfully though, I do indeed have special permission, because I
collaborated with eSpeak's original author Jonathan Duddington (to
help improve eSpeak's English, Mandarin and Ancient Greek voices and
port it to Mac and PocketPC), and he was happy for my pre-compiled
"non-commercial only" combination to go into Gradint's downloads.
This does however mean these Mac and Windows bundles cannot be
upgraded to eSpeak-NG, since the special permission I received from
Jonathan to make a "non-commercial" OALD-integrated download applies
only to my use of his original eSpeak data: the eSpeak-NG contributors
were not informed. Anyway, my process for adding OALD entries to the
eSpeak data has not been as thoroughly tested on recent versions of
the eSpeak-NG data. Gradint can however work with eSpeak-NG if you
supply it separately, and it is possible that eSpeak-NG's improvements
in its default data have reduced the need for OALD data anyway,
although I'm still choosing to ship old-eSpeak plus OALD in my
Mac and Windows 'bundle' downloads.
windows/ contains a copy of ptts.exe extracted from Jampal from
jampal.sourceforge.net with is GPL, and madplay.exe (I can't remember
how I got this binary but I know madplay is GPL), and now LAME.
qtplay is used by Gradint on OS X 10.4, which lacks afplay.
We bundle qtplay with the Mac version, and it has a BSD-like license
(see qtplay.copyright for details).
Mac and Windows additionally ship SOX which is GPL.
To save on server space, I have not included the source code to the
third-party free software binaries I ship. This is possible because
I am performing an unmodified non-commercial distribution of binaries
whose source is widely available and can easily be found on the
Internet, which is something explicitly allowed by the GPL
(GPLv2 section 3c, GPLv3 section 6d). If anyone has difficulty
obtaining source code for any of these binaries then please let me know.
# gradint
Graduated Interval Recall program from http://ssb22.user.srcf.net/gradint
(also mirrored at http://ssb22.gitlab.io/gradint just in case)
Gradint is a program that can be used to make your own self-study audio tapes for learning foreign-language vocabulary. You can use it to help with a course, to prepare for speaking assignments, or just to keep track of the vocabulary you come across.
Gradint uses a variant of the “graduated-interval recall” method published by Pimsleur in 1967. It’s like audio flashcards that appear in a special pattern designed to help you remember. The Pimsleur accelerated language courses use several techniques (they say some are patented), and Gradint does not imitate all that, but this particular 1967 idea is now in the public domain so Gradint can use it to help you learn your own choice of vocabulary.
Gradint gives only audio, so you concentrate on pronunciation. (And so you can listen during daily routines e.g. washing etc, since you don’t have to look or press buttons during a lesson.) Gradint can write its lessons to MP3 or similar files for you to hear later, or it can play them itself and try to adapt to emergency interruptions. The words it uses can be taken from real sound recordings or they can be synthesized by computer. You can add words to your collection at any time, and Gradint can manage collections of thousands of words (and supports batch entry). It can also help you rehearse longer texts such as poems.
Gradint is Free/Libre and Open Source Software distributed under the GNU General Public License (GPL v3).
The Gradint home page (linked above) contains installers for various platforms and details of how to run them. This repository contains the Gradint build environment, including a `Makefile` that can create these installers by packaging up versions of the Python script for various environments (Windows, Mac, Linux, Windows Mobile, S60, Android, RISC OS) plus utilities for running Gradint on a server. Not all of Gradint's functions are available in all environments.
If you are learning Chinese, you might also want Yali Cheng’s Mandarin voice or Cameron Wong’s Cantonese voice. Installers for these may also be found on the Gradint home page, and source in my separate Git repositories `yali-voice`, `yali-lower` and `cameron-voice`. They are larger downloads but less "robotic" than the eSpeak voice.
Once you have installed Gradint, you must tell the program which language(s) you want to learn. On most systems, Gradint will show a GUI which lets you do this. You can also edit the file `settings.txt`.
Then you can give the program some words and phrases to teach. This can be any combination of real recordings and computer-synthesized words, and you can always add more later. You can use the graphical interface (on supported systems), or you can place real recordings in the samples directory and its subdirectories (see the file `README.txt` in the `samples` directory), and add words that you want synthesized by computer to vocab.txt (see the instructions in `vocab.txt`).
If possible, prepare some audio prompts such as “say again” and “do you remember how to say”. These can be real recordings or synthesized text. Some text for English and Chinese is already provided. For any other language you should ideally add your own; for details of how to do this, see the file README.txt in the prompts subdirectory of the samples directory.
You should then be able to run the program every time you want a lesson. For more advanced things, see the settings in the file advanced.txt.
Citation: Silas S. Brown and Peter Robinson. Addressing Print Disabilities in Adult Foreign-language Acquisition. In: Proceedings of the 10th International Conference on Human-Computer Interaction (HCII 2003, Crete, Greece), Vol.4: Universal Access in HCI, pp 38-42.
File moved
......@@ -47,7 +47,8 @@ otherLanguages = ["cant","ko","jp"]
# able to tell the difference between cant_en.wav and an
# ordinary English prompt and might use it wrongly.
possible_otherLanguages = ["cant","ko","jp","en","zh"]
possible_otherLanguages = ["cant","ko","jp","en","zh",
"zhy","zh-yue"]
# You can also fill in otherFirstLanguages below
# (using the same ["item","item"] format) to
......@@ -95,7 +96,7 @@ prefer_espeak = "en"
# "zh" for Zhongwen (Mandarin).
# - You can improve eSpeak's English by installing
# Festival's dictionary and using lexconvert to convert
# it, see http://people.pwf.cam.ac.uk/ssb22/gradint/lexconvert.html
# it, see http://ssb22.user.srcf.net/lexconvert/
# (this has already been done in the bundled version).
# - eSpeak is not very natural-sounding, but it is very
# clear and accurate in English and some other languages
......@@ -107,19 +108,32 @@ prefer_espeak = "en"
sapiVoices = {
# Add them in this format but without the # at the beginning:
# "language abbrev" : ("full voice name", rate),
# For example, if you have "ScanSoft Mei-Ling_Full_22kHz"
#
# For example, for Windows 10 voices (if both English and
# Chinese are installed) you can have:
# "en" : ("Microsoft Hazel Desktop", 16000),
# "zh" : ("Microsoft Huihui Desktop", 16000),
# "zhy" : ("Microsoft Tracy Desktop", 16000),
# "zhy-yue" : ("Microsoft Tracy Desktop", 16000),
# "cant" : ("Microsoft Tracy Desktop", 16000),
# (make sure to set prefer_espeak="" if you want the MS English voice)
#
# Or if you have "ScanSoft Mei-Ling_Full_22kHz"
# (which reads most Chinese hanzi quite well, but can't read
# pinyin and sometimes glitches so be careful), you can have
# "zh" : ("ScanSoft Mei-Ling_Full_22kHz", 22050),
#
# or if you have Loquendo Lisheng (which has prosody reminiscent
# of an Italian-Chinese bilingual, and can pronounce pinyin
# with tone numbers as long as you add punctuation at the end)
# you can have
# "zh" : ("Lisheng", 16000),
#
# or for Ekho Cantonese you can have:
# "zhy" : ("Ekho Cantonese", 8000), # or 16000 for v4.5+
# "zhy-yue" : ("Ekho Cantonese", 8000), # ditto
# "cant" : ("Ekho Cantonese", 8000), # ditto
#
# or if you have other voices in other languages, you can
# use them too. Note that FULL voice names must be used,
# exactly as they are shown in the Control Panel under Speech.
......@@ -144,18 +158,19 @@ sapiSpeeds = {
# MAC OS X VOICES: you can set which voices to use here (if you set
# more than one voice for a language then the first available one is
# used; if you don't set a voice for a language then the first detected
# one is used, unless there's only English voices on the system in which
# case the one set in System Preferences is used).
# Non-English voices might not work on older OS X versions.
# voice supporting that language is used, unless there's only English
# voices on the system in which case the one set in System Preferences
# is used). Non-English voices might not work on older OS X versions.
# Note: if you want the "en" voice to be used, and eSpeak is also
# on the system, remember to remove 'en' from "prefer_espeak" above.
macVoices = {
"en":"Emily Daniel Alex Vicki",
"zh":"Ting-Ting", # OS 10.7+, can read hanzi, pinyin+tone numbers (5 for neutral) and English
"zh":"Ting-Ting Tingting", # OS 10.7+, can read hanzi, pinyin+tone numbers (5 for neutral) and English
"cant":"Sin-Ji", # OS 10.7+
"jp":"Kyoko", # OS 10.7+ (alias of "ja")
"jp":"Kyoko", # OS 10.7+ ("ja" will auto-detect, but we're adding the alias "jp")
"ind":"Damayanti", # OS 10.7+ ("id" will auto-detect: we're adding "ind")
}
# For Mandarin Chinese, you can also use Yali Cheng's syllables
......@@ -173,12 +188,21 @@ macVoices = {
ekho_speed_delta = 0
# (Note: If this is not 0, Ekho will be preferred over partials.)
# ANDROID: set the language of your system's default voice
# (the SL4A module that Gradint uses can't find out for you)
# - normally "en", but some China-modified Android phones
# should set this to "zh" and avoid using pinyin (however I
# have not been able to actually test if SL4A can correctly
# pass a Unicode string to their synths, so perhaps it should
# be set to None and ensure you have recorded prompts)
systemVoice = "en"
# OTHER ENGLISH SYNTHESIZERS (language abbreviation must be "en"):
#
# - Festival Lite on Windows (if all else fails) :
# put flite.exe in the gradint folder
#
# - Linux: install Festival, or flite if you want a US accent
# - GNU/Linux: install Festival, or flite for US accent
#
# - S60: the phone's built-in speech can be used
#
......@@ -188,6 +212,29 @@ ekho_speed_delta = 0
# older "Speech!" utility. These can be used only for
# playing in real-time, not for generating files.
# OTHER MULTI-LANGUAGE SYNTHESISERS:
#
# Piper voices are experimentally supported on GNU/Linux.
# Setup: Download binaries and voices from
# https://github.com/rhasspy/piper
# and put them in the gradint directory (or piper subdirectory)
#
# Coqui voices are experimentally supported on GNU/Linux.
# Setup: pip install coqui-tts[server,zh,ja,ko]
# Then download the voices you want, e.g.:
# from TTS.api import TTS;langs = {}
# for m in TTS().list_models(): langs.setdefault(m.split('/')[1].split('-')[0],[]).append(m)
#
# TTS(langs["zh"][0])
# TTS('tts_models/en/jenny/jenny')
# (If any model crashes during download, be sure to delete the
# result from ~/.local/share/tts before running Gradint. For
# example vocoder_models--ja--kokoro--hifigan_v1 may crash.
# I did say support for these voices is experimental.)
# Gradint detects voices that have been downloaded
# (but prefer_espeak overrides this). The Chinese
# voice does NOT support pinyin.
# You can also set extra_speech to a list of
# (language prefix, command), for example:
# extra_speech=[ ("la","say-latvian"),("de","say-german") ]
......@@ -227,11 +274,9 @@ extra_speech_tofile = []
# not allow in filenames, then you can make a TRANS.TBL file
# inside the synthCache directory (the first word of each
# line is the real filename and the rest of the line is the
# filename that you want gradint to see). On RISC OS this
# should be called TRANS/TBL, and remember to specify /wav
# rather than .wav in its contents. It is also advisable
# not to include spaces in any of the real filenames on RISC
# OS, because RISC OS Python can't always cope.
# filename that you want gradint to see).
# On RISC OS, try not to include spaces in any of the real
# filenames, because RISC OS Python can't always cope.
synthCache = ""
......@@ -329,7 +374,7 @@ lily_file = "C:\\Program Files\\NeoSpeech\\Lily16\\data-common\\userdict\\userdi
# somewhere under C:\Program Files\VW\VT\Lily\M16-SAPI5\lib\
# but I don't know exactly)
# If you want to use SAPI under WINE in Linux
# If you want to use SAPI under WINE in GNU/Linux
# then you can set ptts_program:
ptts_program = None
# (hint: run winecfg and set Windows version to Millenium (ME)
......@@ -421,7 +466,7 @@ partialsDirectory = "partials"
# have difficulty storing all of these (especially for Korean); therefore
# you can use Unicode escaping in filenames, e.g. _ud79d for Unicode D79D
# (equivalent to UTF-8 sequence ED 9E 9D). Example conversion command:
# for N in *; do cp "$N" "/path/to/fat/$(python -c "print repr('$N'.decode('utf-8'))[2:-1].replace(r'\\u','_u')")";done
# for N in *; do cp "$N" "/path/to/fat/$(python2 -c "print repr('$N'.decode('utf-8'))[2:-1].replace(r'\\u','_u')")";done
# When using partials, you can change the length of pause
# between phrases by changing the following (in seconds) :
......@@ -444,6 +489,17 @@ partials_are_sporadic = 0
# set a default in voiceOption below (blank is normal, or set to "-low" etc)
voiceOption = ""
# On Unix-like systems (that support pipes) there is also an option
# to specify external programs to preprocess all input to espeak for
# a specified language. For example if you've used Annotator Generator
# to generate a Chinese-to-pinyin program that's better than espeak
# then you can use this.
espeak_preprocessors={
# for example:
# "zh":"./annotate --raw",
# "zhy":"./annotate --seg",
}
# ------- GUI "preset collections" buttons ---------
# If you are giving gradint to your students then you might
......@@ -477,6 +533,10 @@ voiceOption = ""
# presets, by placing the _disabled directories into Gradint's build
# directory before typing "make".)
# If you just want to disable one of your samples subdirectories, you
# may simply rename the directory to something ending with exclude_from_scan
# (default "_disabled") and DON'T add short-description.txt.
max_extra_buttons = 12
# - this setting limits the number of "add pre-made collection" buttons that
# are displayed on the screen at one time. Set it to 0 to disable this feature.
......@@ -642,10 +702,10 @@ ask_teacherMode = 0
maxNewWords = 5
maxReviseBeforeNewWords = 3
newInitialNumToTry = 5
recentInitialNumToTry = 3
newWordsTryAtLeast = 3 # if introducing a new word and can't
# fit in this number of times, don't bother
newInitialNumToTry = 5 # try to repeat a new word 5x
recentInitialNumToTry = 3 # and recently-learned one 3x
newWordsTryAtLeast = 3 # if a new word won't fit 3x,
# exclude it (leave it till a future lesson)
knownThreshold = 5 # after which it won't repeat so much
reallyKnownThreshold = 10 # after which never added before new words
meaningTestThreshold = 20 # or 0; if >= this then 50% chance of "what meaning" test
......@@ -653,6 +713,9 @@ randomDropThreshold = 14 # after which drop some words even if they can fit
randomDropLevel = 0.67 # fraction of above that is dropped
randomDropThreshold2 = 35 # (or set to the same as above)
randomDropLevel2 = 0.97
seedless = 0 # set this to 1 to make all "random" choices
# reproducible (on the same installation), in case you
# need to reproduce the same Gradint run exactly
shuffleConstant = 2.0 # Used to control how much the number
# of repetitions matters when it is high. Higher values of
# this constant mean it doesn't matter so much and samples
......@@ -662,6 +725,7 @@ transitionPromptThreshold = 10 # after repeating a prompt
advancedPromptThreshold = 20 # ONLY use target-language prompt
transitionPromptThreshold2 = 2 # for 3rd, 4th etc languages
advancedPromptThreshold2 = 5
veryExperiencedThreshold = 1000 # total repetitions until fewer prompts are used
limit_words = max(1,int(maxNewWords * 0.4)) # num words to
# include from limited directories. Done separately for
# EACH limited directory, but limits deeper in the tree are
......@@ -719,7 +783,7 @@ gui_output_directory = "output"
# in which case the first directory that EXISTS will be used
# (or the last one on the list if all else fail).
# Useful if the directory to your MP3 player only appears when
# it's plugged in for example. With Linux automounters you can
# it's plugged in for example. With GNU/Linux automounters
# set "/media/*" as one of the directories, and it will expand to
# whatever removable device is mounted IF there is only one.
......@@ -746,7 +810,7 @@ import_recordings_from = [r"\My Documents", r"\Storage Card\My Documents", r"\Ra
# This can be useful to catch words with the Notes app on a PocketPC
# (which saves its recordings to \My Documents by default).
# ------- GUI translation dictionary ---------
# ------- GUI translation (localisation) dictionary --------
# The format of this is:
# {"en phrase A":{"laX":u"language X translation", "laY":"language Y translation", ...}, "en phrase B":{...}, ...}
......@@ -761,7 +825,8 @@ GUI_translations={
"Word in %s":{"zh":u"%s"},
"Meaning in %s":{"zh":u"%s意思"},
"en":{"zh":u"英文"},
"zh":{"zh":u"中文"},
"zh":{"zh":u"汉语","zh2":u"漢語"},
"cant":{"zh":u"粵語","zh2":u"廣東話"},
"Your first language":{"zh":u"母语","zh2":u"母語"},
"second":{"zh":u"学习的语言","zh2":u"學習的語言"},
"Change languages":{"zh":u"选择其他语言","zh2":u"選擇其他語言"},
......@@ -830,6 +895,11 @@ GUI_translations={
"More than 30 minutes is rarely more helpful. Reduce to 30?":{"zh":u"超过30分钟很少有帮助。我减少到30好吗?","zh2":"超過30分鐘很少有幫助。我減少到30好嗎?"},
"Less than 20 minutes can be a rush. Increase to 20?":{"zh":u"缺乏20分钟可以太赶紧了。我增长到20好吗?","zh2":"缺乏20分鐘可以太趕緊了。我增長到20好嗎?"},
"Proceed anyway?":{"zh":u"反正继续?","zh2":"反正繼續"},
"Just speak a word":{"zh":u"使用机器声音说一词","zh2":u"使用機器聲音說一詞"},
"Add word to my vocab":{"zh":u"把词加到词汇表","zh2":u"把詞加到詞彙表"},
"Make lesson from vocab":{"zh":u"做课","zh2":u"做課"},
"Make lesson":{"zh":u"做课","zh2":u"做課"},
"Record word(s) with mic":{"zh":u"从麦克风录音词语","zh2":u"從麥克風錄音詞語"},
}
# scriptVariants optionally maps language abbreviation to default script
......@@ -957,7 +1027,8 @@ compress_progress_file = 0
# kind of mount then leave it at 0 (it just takes more time).
# (Note: curlftpfs reliability is worse if you use transform_symlinks
# and point gradint to 2 symlinks in the remote filesystem,
# e.g. samples and synth-cache: curlftpfs may confuse them!)
# e.g. samples and synth-cache: curlftpfs may confuse them!
# sshfs better, but best setup is sync before/after running)
paranoid_file_management = 0
......
#!/bin/bash
# Sync gradint build environment to SVN
wget -N http://people.ds.cam.ac.uk/ssb22/gradint/gradint-build.7z || exit 1
rm -rf gradint # (any leftover ../gradint/gradint directory)
7z x gradint-build.7z || exit 1
diff -r gradint-build gradint|grep "^Only in gradint-build"|grep -v \\.svn|sed -e 's,Only in ,svn del ",' -e 's,: ,/,' -e 's/$/"/'|bash
cp -pur gradint/* gradint-build/
find gradint|grep -v \\.svn|sed -e 's/gradint/gradint-build/' -e 's/^/svn add "/' -e 's/$/"/'|bash
rm -rf gradint gradint-build.7z # if need to save space
if test "a$Msg" == a; then export Msg="Gradint update"; fi
svn commit -m "$Msg"
This diff is collapsed.