Skip to content

calternal_notes_core::nlp::tasks_sigils

Sigil-to-tag projection for task inputs, ported from iOS TasksNLP.swift lines 160-161 (@context / +project handling).

  • @word → context/word
  • +word → project/word

A sigil is only recognised when it appears at the start of the string or immediately after ASCII whitespace — the same boundary guard used by tags::extract_tags for #/##. This keeps email addresses intact: foo@bar.com produces nothing because @ is not at a word boundary.

The word charset reuses the Unicode tag-body scanner from tags.rs: a letter or _ starts the body; letters, numbers, marks, _, / and - continue it. A digit-first or empty word is skipped to match # tags.

Source: crates/calternal-notes-core/src/nlp/tasks_sigils.rs

pub fn extract_sigil_tags(text: &str) -> Vec<String>

Extract @context / +project sigil tags from text.

Returns projected tag strings in encounter order, e.g. ["context/work", "project/q3report"] for "email @work +q3report". No deduplication is applied (callers may deduplicate if needed).

Source: crates/calternal-notes-core/src/nlp/tasks_sigils.rs:24