Skip to content

Commit

Permalink
Merge branch 'xiaolai:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MaoPingZou authored Mar 2, 2024
2 parents 3a6d39e + 54935aa commit 009c39f
Show file tree
Hide file tree
Showing 108 changed files with 2,886 additions and 531 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build-enjoy-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Enjoy App
on:
workflow_dispatch:
inputs:
os:
type: choice
description: Choose os
options:
- macos-12
- macos-14
- windows-latest
- ubuntu-latest

jobs:
build:
runs-on: ${{ github.event.inputs.os }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYYMMDDHHmm

- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: "**/node_modules"
key: ${{ github.event.inputs.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install

- name: Install Apple certificate
if: contains(github.event.inputs.os, 'macos')
env:
MACOS_CERTIFICATE_APPLICATION_BASE64: ${{ secrets.MACOS_CERTIFICATE_APPLICATION_BASE64 }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
run: ./enjoy/scripts/add-macos-cert.sh

- name: Make
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
APPLE_ID: ${{ runner.os == 'macOS' && secrets.APPLE_ID || '' }}
APPLE_APP_PASSWORD: ${{ runner.os == 'macOS' && secrets.APPLE_APP_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ runner.os == 'macOS' && secrets.APPLE_TEAM_ID || '' }}
run: yarn run enjoy:make

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Enjoy-${{ runner.os }}-${{ github.event.inputs.os == 'macos-14' && 'arm64' || 'x64' }}-build-${{ github.ref_name }}-${{ steps.current-time.outputs.formattedTime }}
path: |
enjoy/out/make/**/*.deb
enjoy/out/make/**/*.rpm
enjoy/out/make/**/*.zip
enjoy/out/make/**/*.exe
enjoy/out/make/**/*.dmg
46 changes: 46 additions & 0 deletions .github/workflows/deploy-enjoy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy Enjoy Docs website

on:
push:
branches:
- main
paths:
- "enjoy-docs/**"
pull_request:
branches:
- main
paths:
- "enjoy-docs/**"

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
# checkout the code
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Setup node env
uses: actions/setup-node@master
with:
node-version: "20"

- name: Install Independents
run: yarn install

- name: Build
run: yarn docs:build

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy .vitepress/dist --project-name=enjoy-docs
workingDirectory: "enjoy-docs"

35 changes: 27 additions & 8 deletions .github/workflows/release-enjoy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,39 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-12, macos-14, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
- name: install dependencies

- name: Install dependencies
run: yarn install
- name: publish

- name: Install Apple certificate
if: contains(github.event.inputs.os, 'macos')
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: yarn publish:enjoy
- if: matrix.os == 'macos-latest'
MACOS_CERTIFICATE_APPLICATION_BASE64: ${{ secrets.MACOS_CERTIFICATE_APPLICATION_BASE64 }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
run: ./enjoy/scripts/add-macos-cert.sh

- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
PACKAGE_OS_ARCH: arm64
run: yarn run publish:enjoy --arch=arm64
APPLE_ID: ${{ runner.os == 'macOS' && secrets.APPLE_ID || '' }}
APPLE_APP_PASSWORD: ${{ runner.os == 'macOS' && secrets.APPLE_APP_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ runner.os == 'macOS' && secrets.APPLE_TEAM_ID || '' }}
run: yarn enjoy:publish

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Enjoy-${{ runner.os }}-${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}-build-${{ github.ref_name }}
path: |
enjoy/out/make/**/*.deb
enjoy/out/make/**/*.rpm
enjoy/out/make/**/*.zip
enjoy/out/make/**/*.exe
enjoy/out/make/**/*.dmg
44 changes: 24 additions & 20 deletions .github/workflows/test-enjoy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,47 @@ on:
- "enjoy/**/*.js"
- "enjoy/**/*.mjs"
jobs:
e2e:
e2e-test:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
macos-latest,
macos-13,
macos-14,
windows-2019,
windows-latest,
ubuntu-latest,
]
os: [macos-12, macos-14, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: "**/node_modules"
key: ${{ github.event.inputs.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: npm install -g yarn && yarn
- if: matrix.os == 'macos-latest'
name: Install sdl2 for macos
run: yarn install

- name: Install sdl2 for macOS12
if: matrix.os == 'macos-12'
run: |
brew update
brew install sdl2
- if: startsWith(matrix.os, 'ubuntu')
name: Run tests with xvfb-run on ubuntu
- name: Run tests with xvfb-run on Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:enjoy
- if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
name: Run tests
run: yarn test:enjoy
- name: Run tests on macOS or Windows
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
run: yarn enjoy:test

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
name: ${{matrix.os}}-playwright-report
path: enjoy/playwright-report/
retention-days: 30
6 changes: 3 additions & 3 deletions 1000-hours/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export default withMermaid(
// provider: 'local'
provider: 'algolia',
options: {
appId: 'QF5TVZ8TIO',
apiKey: '8dac3a5e27daaaf57efc72604ca08b98',
indexName: '1000h_prod'
appId: 'KKK8CORNSR',
apiKey: 'd613ff31a535ff1e9535cf9c88ec420a',
indexName: '1000h'
}
},

Expand Down
2 changes: 1 addition & 1 deletion 1000-hours/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

这场训练虽然以**英语**为示范训练标的,但,在其过程中,你的**母语**水平只能会水涨船高。虽然,你的第二语言水平**必然**受到第一语言的**限制**。但是,反过来,在你通过努力把原本的第二语言练成第一语言的过程中,你原本的第一语言只能比原来更强。新的语言会**反哺**之前已经掌握的语言。

这场训练会直接改变你的**大脑结构**。完成这场训练的过程中,你的大脑内部,**灰质密度**会变得越来越高,**灰质体积**会变得越来越大,**白质覆盖面积**也会越来越广。如果用 fMRI(核磁共振成像)设备扫描,那么,这一切对你来说都应该是肉眼可见的变化。
这场训练会直接改变你的**大脑结构**。完成这场训练的过程中,你的大脑内部,**灰质密度**会变得越来越高,**灰质体积**会变得越来越大,**白质覆盖面积**也会越来越广。如果用 fMRI(功能性磁共振成像)设备扫描,那么,这一切对你来说都应该是肉眼可见的变化。

如此这般的大脑结构变化,对一个人产生的影响,绝不仅仅是多掌握了一门外语或者提高了自然语言使用能力那么简单,它带来的变化非常普遍且又深远。

Expand Down
Binary file added 1000-hours/public/audios/academically-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/academically-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/awful-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/awful-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/didn't-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/didn't-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/fear-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/fear-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/fill-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/fill-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/it-was-your-job-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/it-was-your-job-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/little-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/little-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/miss-you-so-much-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/miss-you-so-much-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/rhythm-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/rhythm-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/seal-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/seal-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/shall-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/shall-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/tale-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/tale-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/time-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/time-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/wear-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/wear-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/well-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/well-us.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/wouldn't-uk.mp3
Binary file not shown.
Binary file added 1000-hours/public/audios/wouldn't-us.mp3
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"id": "9aad6634-e833-4ec4-b285-84e051329712",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pygame 2.5.2 (SDL 2.28.3, Python 3.11.5)\n",
"Hello from the pygame community. https://www.pygame.org/contribute.html\n",
"Files created!\n"
]
}
Expand All @@ -51,7 +49,7 @@
"import pygame\n",
"\n",
"TEXT = \"\"\"\n",
"plaid\n",
"time\n",
"\"\"\"\n",
"\n",
"Wordlist = TEXT.split(\",\")\n",
Expand Down
8 changes: 7 additions & 1 deletion 1000-hours/sounds-of-english/01-1-vowels.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@

:::

::: tip

在 D.J. 的某些版本里, `əʊ`,也被写作`` —— 所以现在也有一些词典用的是 ``。我的个人看法是,写作 `əʊ` 相对更合理,因为 `o` 并没有在 6 个基础音素里出现过。

:::

::: info

有时你会看到三种颜色的小喇叭图标,暗红色<span class="speak-word-inline" data-audio-uk="null-file.mp3"></span>、浅蓝色<span class="speak-word-inline" data-audio-us="null-file.mp3"></span>,或者黑色<span class="speak-word-inline" data-audio-other="null-file.mp3"></span>,用鼠标点击它可以听音频播放。比如,*happy* `/ˈhæpi/` —— 暗红色喇叭<span class="speak-word-inline" data-audio-uk="/audios/happy-uk.mp3"></span>是英式发音;浅蓝色<span class="speak-word-inline" data-audio-us="/audios/happy-us.mp3"></span>是美式发音;黑色<span class="speak-word-inline" data-audio-other="/audios/happy-zh-liaoning.mp3"></span>是其他口音。

:::
:::
2 changes: 1 addition & 1 deletion 1000-hours/sounds-of-english/01-3-us-phonemes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

关于美式发音的音标标注,可以大致总结为以下几点:

> * 短元音 `ʌ` 变得与 `ə` 非常接近,甚至常常直接被 `ə` 替代。比如,but `/bʌt/` 直接被标注为 `/bət/`
> * 短元音 `ʌ` 变得与 `ə` 非常接近,甚至常常直接被 `ə` 替代。比如,*but* `/bʌt/` 直接被标注为 `/bət/`
> * 长短元音不统一使用 `ː` 区分,而是`ə/ɑ``ə/ɜ``ɚ/ɝ``e/æ``ɪ/i``ʊ/u``ɒ/ɔ`
> * 短元音 `e` 有时用 `ɛ` 标注。
> * 短元音 `ə` ,由于经常附带着 `ʳ` 音,常常被标注为 `ɚ`;不带有 `ʳ` 音的时候,被标注为 `ɜ`
Expand Down
4 changes: 3 additions & 1 deletion 1000-hours/sounds-of-english/10-ɔ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

这一对元音在发声的时候,嘴唇动作非常明显,嘴唇得形成一个小的圆形之后开始发音。另外,`ɔː` 可能会被美国人读成 `ɔʳ` ,更像是双元音 `ɔəʳ` —— 但,再一次,还是不一定都如此,需要逐个核对。

另外,D.J. 音标最初的时候短元音用 `ɔ`,长元音用 `ɔː`;但后来短元音 `ɔ` 开始使用笔划上闭口的 `ɒ`,长元音依然使用带着长音符号且笔划上开口的 `ɔː`
::: info
D.J. 音标最初的时候短元音用 `ɔ`,长元音用 `ɔː`;但后来短元音 `ɔ` 开始使用笔划上闭口的 `ɒ`,长元音依然使用带着长音符号且笔划上开口的 `ɔː`
:::
8 changes: 1 addition & 7 deletions 1000-hours/sounds-of-english/11-aɪ.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@

亚洲人常常会把所有双元音都读成单元音的长度。不仅如此,他们也常常会不由自主地把很多长元音也读成相应更短的版本。这是因为在亚洲语系往往以字(而不是词)为最小单位,而后,每个字都是单音节,每个音节里的元音(比如,中文中的 “韵母”)都是等长的。

另外,有 3 个双元音里有 `ʊ` 这个音,`aʊ, əʊ, ʊə` —— 若是不配合着嘴唇的动作,就读不准它们。而剩下的 5 个双元音,`aɪ, eɪ, ɔɪ, eə, ɪə` 都是在嘴唇几乎不动的情况下完成的,全靠喉咙部位的动作。

::: tip

在 D.J. 的某些版本里, `əʊ`,也被写作`` —— 所以现在也有一些词典用的是 ``。我的个人看法是,写作 `əʊ` 相对更合理,因为 `o` 并没有在 6 个基础音素里出现过。

:::
另外,有 3 个双元音里有 `ʊ` 这个音,`aʊ, əʊ, ʊə` —— 若是不配合着嘴唇的动作,就读不准它们。而剩下的 5 个双元音,`aɪ, eɪ, ɔɪ, eə, ɪə` 都是在嘴唇几乎不动的情况下完成的,全靠喉咙部位的动作。
12 changes: 11 additions & 1 deletion 1000-hours/sounds-of-english/13-pbmnfkgh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@

于是,老的习惯一不小心就会冲进新学的语言,总是不由自主地在这些音后面加上一个 `ə`…… 比如,很多人总是把 *please* <span class="speak-word-inline" data-audio-uk="/audios/please-uk.mp3" data-audio-us="/audios/please-us.mp3"></span>读得听起来像是 *police* <span class="speak-word-inline" data-audio-uk="/audios/police-uk.mp3" data-audio-us="/audios/police-us.mp3"></span>的第一个音节……

如果发现自己总是不小心在这些辅音后加上不应该有的 `ə` 的话,不妨新学一个英文中没有的元音 `ɤ` <span class="speak-word-inline" data-audio-uk="/audios/ɤ-Close-mid_back_unrounded_vowel.ogg.mp3"></span> —— 用这个 `ɤ` 音替代那个不应该有的 `ə`,效果也还不错。
如果发现自己总是不小心在这些辅音后加上不应该有的 `ə` 的话,不妨新学一个英文中没有的元音 `ɤ` <span class="speak-word-inline" data-audio-uk="/audios/ɤ-Close-mid_back_unrounded_vowel.ogg.mp3"></span> —— 用这个 `ɤ` 音替代那个不应该有的 `ə`,效果也还不错。

::: tip
关于 `ɤ`,你可以尝试一下用 *academically* 这个 6 个音节的词汇仔细体会一下。

词典里,它的音标标注一般是:`/ˌækəˈdemɪk(ə)li/`<span class="speak-word-inline" data-audio-uk="/audios/academically-uk.mp3" data-audio-us="/audios/academically-us.mp3"></span>—— `k` 后面的 `ə` 带着括号的意思是说,它 “可有可无” —— 所以,你可以把它读成 `/ˌækəˈdemɪkli/` 或者 `/ˌækəˈdemɪkəli/`。未经矫正的带有明显中国口音的人,可能会把 `ə` 误读成 `əu`,也就是 `/ˌækəˈdemɪkəuli/`…… 不过,

无论哪种情况,如果你把 `ə` 直接改成很轻的 `ɤ` —— `/ˌækəˈdemɪkɤli/` —— 听起来就是全无口音的状态。甚至,你还可以试试 `/ˌækɤˈdemɪkɤli/`,也就是说,把两个 `ə` 都变成 `ɤ`,再感觉一下。
:::

`ɤ``ə` 的重点差别在于,`ɤ` 发声时,口腔内气流共鸣位置很靠前,且相当轻微;`ə` 发声时,口腔内气流共鸣位置靠后,相对声音略大且更为清楚。
5 changes: 5 additions & 0 deletions 1000-hours/sounds-of-english/15-mn.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
> * *wrong idea*`/rɔn aɪˈdiə/`
> * *thinking of*`/ˈθɪŋkɪn əv/`
另外,`m``n` 常常会使之前的辅音,尤其是 `d``t` 变成**音节辅音***syllabic consonant*),比如,*didn't* `/ˈdɪd̩nt/`<span class="speak-word-inline" data-audio-uk="/audios/didn't-uk.mp3" data-audio-us="/audios/didn't-us.mp3"></span>, *wouldn't* `/ˈwʊd̩nt/`<span class="speak-word-inline" data-audio-uk="/audios/wouldn't-uk.mp3" data-audio-us="/audios/wouldn't-us.mp3"></span> —— 独自构成音节的那个辅音,例如这里的 `d`,下面多了个竖线作为标注,``。再比如,*rhythm* `/ˈrɪð̩m/`<span class="speak-word-inline" data-audio-uk="/audios/rhythm-uk.mp3" data-audio-us="/audios/rhythm-us.mp3"></span>。

有些词典会直接将 *didn't* 标注为 `/ˈdɪdənt/`,将 *wouldn't* 标注为 `/ˈwʊdənt/`,将 *rhythm* 标注成 `/ˈrɪðəm/`…… 但是,音节辅音内的元音音素,更准确地讲,更接近 `ɤ`[2.2.1](13-pbmnfkgh))而不是 `ə` —— 这个细微差异,竟然会使美国人轻易地听出外国口音[^1]

[^1]: *Manual of Amewrican English Pronuciation*, 4th edition, by Clifford H. Prator, Jr. Betty Wallace Robinett. Page 118.
4 changes: 3 additions & 1 deletion 1000-hours/sounds-of-english/16-tdsz.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@

`t, d, s, z` 这四个辅音发声时起始的**舌尖位置**,同样影响基于它们的另外三个辅音,`ʃ, tʃ, dʒ`…… 比较有趣的是,中文的普通话里恰好有对应的**卷舌音**`sh, ch, zh`。找对发这三个声母发声时起始的舌尖位置,从那里开始读英文的 `t, d, s, z` 就对了。只不过,有一点点的区别,中文的 `sh, zh` 舌尖顶着上颚,同样的方式读出来的是英文的 `ʃ, dʒ`。而英文的 `s, z` 离上颚还有一点距离,但,不像中文的 `s, z` 那样靠近牙齿。

对中文普通话使用者来说,必须为这几个辅音学习新的发声方式。可以用 *students* `/ˈstudənts/` <span class="speak-word-inline" data-audio-uk="/audios/students-uk.mp3" data-audio-us="/audios/students-us.mp3"></span> 这个词作为起步反复练习。以后随时注意这些辅音发声时起始的 “舌尖位置”。
另外,美国人在说 `t` 这个辅音的时候,经常会把它读成**送气音***asperated*),即,发着 `h` 的音读出,比如 *time* `/tʰaɪm/`<span class="speak-word-inline" data-audio-uk="/audios/time-uk.mp3" data-audio-us="/audios/time-us.mp3"></span>。

对中文普通话使用者来说,必须为这几个辅音学习新的发声方式。可以用 *students* `/ˈstudənts/` <span class="speak-word-inline" data-audio-uk="/audios/students-uk.mp3" data-audio-us="/audios/students-us.mp3"></span> 这个词作为起步反复练习。以后随时注意这些辅音发声时起始的**舌尖位置**
Loading

0 comments on commit 009c39f

Please sign in to comment.