nimcorpora

Types

Corpora = ref object

Procs

proc categories(_: Corpora): seq[string] {....raises: [OSError],
    tags: [ReadDirEffect].}
Alias for getCategories
proc getCategories(_: Corpora): seq[string] {....raises: [OSError],
    tags: [ReadDirEffect].}
Get all categories (directories) in the Corpora data.
proc getFile(_: Corpora; category, subcategory: string): JsonNode {.
    ...raises: [IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
Get a file by its category and subcategory
proc getFile(_: Corpora; path: string): JsonNode {.
    ...raises: [IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
Get a file by its path. Input path as subcategory (e.x "animals/ant_anatomy")
proc getFiles(_: Corpora; category: string): seq[JsonNode] {.
    ...raises: [OSError, IOError, JsonParsingError, ValueError, Exception],
    tags: [ReadDirEffect, ReadIOEffect, WriteIOEffect].}
Get all files under category
proc getFiles(_: Corpora; category: string; subcategories: openArray[string]): seq[
    JsonNode] {....raises: [IOError, OSError, JsonParsingError, ValueError,
                         Exception], tags: [ReadIOEffect, WriteIOEffect].}
Get multiple files from subcategories under category
proc getFiles(_: Corpora; paths: openArray[string]): seq[JsonNode] {.
    ...raises: [IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
Get multiple files by their paths.
proc getFilesByCategories(_: Corpora; categories: openArray[string]): seq[
    seq[JsonNode]] {....raises: [OSError, IOError, JsonParsingError, ValueError,
                              Exception],
                     tags: [ReadDirEffect, ReadIOEffect, WriteIOEffect].}
Get all files under categories.
proc getSubcategories(_: Corpora): seq[string] {....raises: [OSError],
    tags: [ReadDirEffect].}
Get all subcategories (a.k.a the json files in the data) under all categories
proc getSubcategories(_: Corpora; categories: openArray[string]): seq[
    seq[string]] {....raises: [OSError], tags: [ReadDirEffect].}
Get all subcategories under categories
proc getSubcategories(_: Corpora; category: string): seq[string] {.
    ...raises: [OSError], tags: [ReadDirEffect].}
Get all subcategories under category
proc newCorpora(): Corpora {....raises: [], tags: [].}
Get a new Corpora object. Needed to access Corpora data.
proc subcategories(_: Corpora): seq[string] {....raises: [OSError],
    tags: [ReadDirEffect].}
Alias for getSubcategories
proc update(_: Corpora; output: bool = off) {....raises: [OSError, IOError,
    ValueError, HttpRequestError, LibraryError, Exception, SslError,
    TimeoutError, ProtocolError, KeyError, ZippyError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect, WriteDirEffect, ReadDirEffect].}
Update Corpora data
proc updateRelease(_: Corpora; output: bool = off) {....raises: [OSError, IOError,
    ValueError, HttpRequestError, LibraryError, Exception, SslError,
    TimeoutError, ProtocolError, KeyError, ZippyError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, TimeEffect, WriteDirEffect, ReadDirEffect].}
Update Corpora data