Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes made at Elm London Code night #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ main =


type alias Card =
( String, String )
( String, List FormattedText )


type alias CardDeck =
Expand All @@ -25,11 +25,16 @@ type alias CardDeck =

type alias Model =
{ entries : CardDeck
, displayed : String
, displayed : List FormattedText
, decks : List String
}


type FormattedText
= PlainText String
| UnderlinedText String


model : Model
model =
{ entries = []
Expand All @@ -39,7 +44,7 @@ model =


initDisplayed =
"Click an entry to see its associated answer/pronunciation/solution."
[ PlainText "Click an entry to see its associated answer/pronunciation/solution." ]


init : ( Model, Cmd Msg )
Expand All @@ -52,7 +57,7 @@ init =


type Msg
= Show String
= Show (List FormattedText)
| NewDeck (Result Http.Error CardDeck)
| ChangeDeck String

Expand All @@ -77,7 +82,7 @@ update msg model =

NewDeck (Err err) ->
( { model
| displayed = "Error loading new deck; staying on current deck."
| displayed = [ PlainText "Error loading new deck; staying on current deck." ]
}
, Cmd.none
)
Expand Down Expand Up @@ -131,10 +136,10 @@ getDeckData deckString =
url =
"./" ++ deckString ++ ".json"
in
Http.send NewDeck (Http.get url decodeDeckData)
Http.send NewDeck (Http.get url decodeDeckData)


decodeDeckData : Decode.Decoder (List ( String, String ))
decodeDeckData : Decode.Decoder CardDeck
decodeDeckData =
Decode.list (arrayAsTuple2 Decode.string Decode.string)

Expand Down
6 changes: 3 additions & 3 deletions src/polish-foods.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[ ["pączek", "doughnut filled with jam"]
, ["barszcz", "beetroot soup"]
, ["pierogi", "dumplings"]
[ ["pączek",[ "doughnut filled with jam"]]
, ["barszcz",[ "beetroot soup"]]
, ["pierogi",[ "dumplings"]]
]
86 changes: 43 additions & 43 deletions src/polish-pronunciation.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
[ [ "a", "large" ]
, [ "ą", "nasal o as own or French bon" ]
, [ "b", "bed" ]
, [ "c", "pits, Tsar, a bit like s-stuff with t before it" ]
, [ "ć", "cheap (alveolo-palatal), tongue towards front and roof, a bit like s-stuff with t before it" ]
, [ "ci", "same as ć" ]
, [ "cz", "cheap, tongue towards lower teeth and back, a bit like s-stuff with t before it" ]
, [ "ch", "hello" ]
, [ "d", "dog" ]
, [ "dz", "voiced 'c', like voids, like z series with d before it" ]
, [ "dź", "voiced 'ć', like jeep, like z series with d before it" ]
, [ "dzi", "same as dź" ]
, [ "dż", "voiced 'cz', like djinn, like z series with d before it" ]
, [ "e", "bed" ]
, [ "ę", "nasal e, French pain" ]
, [ "f", "fingers" ]
, [ "g", "go" ]
, [ "h", "hello, maybe a bit towards Scots loch" ]
, [ "i", "meet" ]
, [ "j", "yes" ]
, [ "k", "king" ]
, [ "l", "light" ]
, [ "ł", "will" ]
, [ "m", "men" ]
, [ "n", "not" ]
, [ "ń", "canyon (alveolo-palatal)" ]
, [ "o", "British English long" ]
, [ "ó", "boot" ]
, [ "p", "spot" ]
, [ "r", "trilled r" ]
, [ "rz", "same as ż" ]
, [ "s", "sea" ]
, [ "ś", "sheep (alveolo-palatal), tongue towards front and roof" ]
, [ "si", "same as ś" ]
, [ "sz", "sheep (alveolo-palatal), tongue towards lower teeth and back" ]
, [ "t", "start" ]
, [ "u", "boot" ]
, [ "w", "vox" ]
, [ "y", "short i as in bit" ]
, [ "z", "zoo" ]
, [ "ź", "vision (alveolo-palatal), tongue towards front and roof" ]
, [ "zi", "same as ź" ]
, [ "ż", "vision, tongue towards lower teeth and back" ]
[ [ "a", ["l", {"underlined": "a"}, "rge"] ]
, [ "ą", ["nasal o as own or French bon"] ]
, [ "b", ["bed"] ]
, [ "c", ["pits, Tsar, a bit like s-stuff with t before it"] ]
, [ "ć", ["cheap (alveolo-palatal), tongue towards front and roof, a bit like s-stuff with t before it"] ]
, [ "ci", ["same as ć"] ]
, [ "cz", ["cheap, tongue towards lower teeth and back, a bit like s-stuff with t before it"] ]
, [ "ch", ["hello"] ]
, [ "d", ["dog"] ]
, [ "dz", ["voiced 'c', like voids, like z series with d before it"] ]
, [ "dź", ["voiced 'ć', like jeep, like z series with d before it"] ]
, [ "dzi", ["same as dź"] ]
, [ "dż", ["voiced 'cz', like djinn, like z series with d before it"] ]
, [ "e", ["bed"] ]
, [ "ę", ["nasal e, French pain"] ]
, [ "f", ["fingers"] ]
, [ "g", ["go"] ]
, [ "h", ["hello, maybe a bit towards Scots loch"] ]
, [ "i", ["meet"] ]
, [ "j", ["yes"] ]
, [ "k", ["king"] ]
, [ "l", ["light"] ]
, [ "ł", ["will"] ]
, [ "m", ["men"] ]
, [ "n", ["not"] ]
, [ "ń", ["canyon (alveolo-palatal)"] ]
, [ "o", ["British English long"] ]
, [ "ó", ["boot"] ]
, [ "p", ["spot"] ]
, [ "r", ["trilled r"] ]
, [ "rz", ["same as ż"] ]
, [ "s", ["sea"] ]
, [ "ś", ["sheep (alveolo-palatal), tongue towards front and roof"] ]
, [ "si", ["same as ś"] ]
, [ "sz", ["sheep (alveolo-palatal), tongue towards lower teeth and back"] ]
, [ "t", ["start"] ]
, [ "u", ["boot"] ]
, [ "w", ["vox"] ]
, [ "y", ["short i as in bit"] ]
, [ "z", ["zoo"] ]
, [ "ź", ["vision (alveolo-palatal), tongue towards front and roof"] ]
, [ "zi", ["same as ź"] ]
, [ "ż", ["vision, tongue towards lower teeth and back"] ]
]