Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
inyono committed Jun 29, 2018
2 parents 9825052 + a57523c commit 01361ac
Show file tree
Hide file tree
Showing 6 changed files with 551 additions and 470 deletions.
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Serlo ABC",
"slug": "serlo-abc",
"privacy": "public",
"sdkVersion": "27.0.0",
"sdkVersion": "28.0.0",
"version": "1.1.0",
"icon": "./appIcon.png",
"packagerOpts": {
Expand All @@ -27,7 +27,7 @@
"com.htc.launcher.permission.READ_SETTINGS",
"om.htc.launcher.permission.UPDATE_SHORTCUT"
],
"versionCode": 3
"versionCode": 4
},
"assetBundlePatterns": [
"src/assets/images/*",
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serlo-abc",
"version": "1.1.0",
"version": "1.1.1",
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"repository": "serlo-org/serlo-abc",
"scripts": {
Expand Down Expand Up @@ -45,51 +45,51 @@
},
"dependencies": {
"chroma-js": "^1.3.7",
"expo": "^27.0.2",
"expo": "^28.0.0",
"fluent-ffmpeg": "^2.1.2",
"ramda": "^0.25.0",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-27.0.2.tar.gz",
"react-native": "https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz",
"react-native-swipe-gestures": "^1.0.2",
"react-router-native": "^4.2.0",
"sentry-expo": "^1.9.0"
"react-router-native": "^4.3.0",
"sentry-expo": "~1.9.0"
},
"devDependencies": {
"@storybook/addon-actions": "^3.4.6",
"@storybook/react-native": "^3.4.6",
"@storybook/addon-actions": "^3.4.8",
"@storybook/react-native": "^3.4.8",
"@types/chroma-js": "^1.3.5",
"@types/fluent-ffmpeg": "^2.1.6",
"@types/gm": "^1.18.0",
"@types/jest": "^23.0.0",
"@types/ramda": "^0.25.32",
"@types/react-native": "^0.55.16",
"@types/jest": "^23.1.3",
"@types/ramda": "^0.25.34",
"@types/react-native": "^0.55.26",
"@types/react-test-renderer": "^16.0.1",
"@types/storybook__addon-actions": "^3.0.3",
"commitizen": "^2.10.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.19.1",
"eslint": "^5.0.1",
"eslint-config-universe": "^1.0.7",
"exp": "^54.0.1",
"exp": "^55.0.4",
"gm": "^1.23.1",
"husky": "^0.14.3",
"jest": "^23.1.0",
"jest-expo": "^27.0.1",
"lint-staged": "^7.1.3",
"jest": "^23.2.0",
"jest-expo": "^28.0.0",
"lint-staged": "^7.2.0",
"npm-check-updates": "^2.14.2",
"npm-run-all": "^4.1.3",
"prettier": "^1.13.4",
"prettier": "^1.13.7",
"react-devtools": "^3.2.3",
"react-dom": "16.3.1",
"react-native-scripts": "^1.14.0",
"react-native-typescript-transformer": "^1.2.9",
"react-test-renderer": "^16.4.0",
"react-native-typescript-transformer": "^1.2.10",
"react-test-renderer": "^16.4.1",
"ts-jest": "^22.4.6",
"ts-node": "^6.1.0",
"ts-node": "^7.0.0",
"tslint": "^5.10.0",
"tslint-config-prettier": "^1.13.0",
"typescript": "^2.9.1"
"typescript": "^2.9.2"
},
"private": true,
"lint-staged": {
Expand Down
Binary file modified packages/assets/words/sounds/werkzeug_short.mp3
Binary file not shown.
41 changes: 39 additions & 2 deletions packages/entities/exercises/has-phoneme.exercise.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { forEach } from 'ramda';

import { Maybe } from '../../maybe';
import { AbstractWord } from '../word';
import { Word } from '../word';
import {
AbstractExercise,
ExerciseFixture,
ExercisePropsFixture
} from './abstract-exercise.interface';

export interface HasPhonemeProps {
word: AbstractWord;
word: Word;
phoneme: string;
}

Expand Down Expand Up @@ -92,7 +94,42 @@ export class HasPhoneme extends AbstractExercise<
const { phoneme, word } = this.props;
const phonemeString: string = phoneme.toUpperCase();
const wordString: string = word.toString().toUpperCase();
const syllablesRawString: Maybe<string> = word.getRawSingular();

// check for phoneme in syllableString
if (syllablesRawString) {
let syllablesStringFiltered = syllablesRawString
.replace(/['-]/g, '')
.toUpperCase();

// remove longer phonemes containing phonemeString from syllableRawString
const multiLetterPhonemes: string[] = [
'SCH',
'CH',
'EI',
'AU',
'EU',
'QU'
];
forEach((multiLetterPhoneme: string) => {
if (
multiLetterPhoneme.indexOf(phonemeString) !== -1 &&
multiLetterPhoneme !== phonemeString
) {
syllablesStringFiltered = syllablesStringFiltered.replace(
multiLetterPhoneme,
''
);
}
}, multiLetterPhonemes);

// combine syllables (for phonemes like ng wich span multiple syllables)
syllablesStringFiltered = syllablesStringFiltered.replace('|', '');

return syllablesStringFiltered.indexOf(phonemeString) !== -1;
}

// fallback
return wordString.indexOf(phonemeString) !== -1;
}
}
Binary file modified src/assets/words/sounds/werkzeug_short.mp3
Binary file not shown.
Loading

0 comments on commit 01361ac

Please sign in to comment.