Word Count

Count words in text. Use to determine length of a document, e.g. to determine if it needs to be summarized before further use

bdambrosio f60c022 3 files · 2.7 KB Updated

File contents

word-count

Simple deterministic word counting for text analysis.

Input

  • target: Note ID or variable containing text to count

Output

Success (status: "success"):

  • value: String with word count (e.g., "Word count: 6")
  • extra.count: Integer count

Behavior

  • Simple whitespace-based counting
  • Fast and reliable
  • Works on any text content

Planning Notes

  • Use to check document length before processing
  • Useful for determining if summarization is needed

Example

{"type":"word-count","target":"$text","out":"$count"}

bdambrosio/cognitive_workbench/tree/main/src/tools_out/word-count commit f60c022ca3

Frequently asked questions

npx skillmds@latest add bdambrosio/word-count