Corpus

marola.knowledge.Corpus
object Corpus

The corpus is a directory of Markdown files (knowledge/ at the repo root by default), plus a safety/ subdirectory (MIP-0022) for documents whose answers must always carry the emergency footer.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Corpus.type

Members list

Value members

Concrete methods

def chunkDocument(markdown: String, safety: Boolean = ...): List[CorpusChunk]
def cosine(a: Vector[Double], b: Vector[Double]): Double

Cosine similarity; 0 for a zero vector rather than NaN.

Cosine similarity; 0 for a zero vector rather than NaN.

Attributes

def listFiles(dir: Path): List[Path]

Every .md file directly under dir, plus every .md file directly under dir/safety, one level deep — not a general recursive walk, so a stray subdirectory doesn't silently join the corpus.

Every .md file directly under dir, plus every .md file directly under dir/safety, one level deep — not a general recursive walk, so a stray subdirectory doesn't silently join the corpus.

Attributes

def load(dir: Path): List[CorpusChunk] < Sync

Concrete fields

val MaxChunkChars: Int