Skip to content

Commit

Permalink
chore: Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern committed Jun 9, 2024
1 parent 7a0ef65 commit 6f0451c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
gleam add tatoeba
```

To get a sentence, use `sentence.get(id: <id>)`:
To get a sentence, use `sentence.get(id: <sentence id>)`, passing a sentence ID obtained from `sentence.new_id(id: <id>)`:

```gleam
import gleam/io
import tatoeba/sentence
pub fn main() {
let assert Some(sentence) = sentence.get(id: 12212258)
let assert Ok(id) = sentence.new_id(12_212_258)
let assert Ok(Some(sentence)) = sentence.get(id)
io.println(sentence.text) // "This work is free of charge."
}
Expand Down

0 comments on commit 6f0451c

Please sign in to comment.