// A news site: articles split into sentences for a reading aid, and meta descriptions of whole sentences.
//
//   quillo run sentences.qwe      then open http://localhost:8080/article

use "sentences.qwer"

let ARTICLE = "Dr. Smith arrived at 3 p.m. on Jan. 5. She met J. R. R. Tolkien's biographer at St. Mary's, e.g. near the U.S. embassy. The bill came to $4.50, i.e. less than expected! \"Was it worth it?\" she asked. Nobody knew.\n\nNext steps\nThe board meets again in March."

route GET /article {
    let parts = sentences_split(ARTICLE, "en")
    {
        count: sentences_count(ARTICLE, "en"),
        sentences: parts,
        meta: sentences_preview(ARTICLE, 160, "en"),
        tiny: sentences_preview(ARTICLE, 20, "en"),
        german: sentences_split("Wir treffen uns z.B. bei Hrn. Müller in der Goethestr. 5. Er kommt ca. um 8 Uhr.", "de"),
        french: sentences_split("M. Dupont habite av. Foch. Mme Martin aussi.", "fr"),
        where: first(sentences_spans(ARTICLE, "en")),
    }
}
