Module: ClaudeMemory::Ingest::ContentSanitizer::Pure
- Defined in:
- lib/claude_memory/ingest/content_sanitizer.rb
Class Method Summary collapse
Class Method Details
.all_tags ⇒ Object
28 29 30 31 32 33 |
# File 'lib/claude_memory/ingest/content_sanitizer.rb', line 28 def self. @all_tags ||= begin all_tag_names = ContentSanitizer::SYSTEM_TAGS + ContentSanitizer::USER_TAGS all_tag_names.map { |name| PrivacyTag.new(name) } end end |
.count_tags(text, tags) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/claude_memory/ingest/content_sanitizer.rb', line 39 def self.(text, ) .sum do |tag| opening_pattern = /<#{Regexp.escape(tag.name)}>/ text.scan(opening_pattern).size end end |
.strip_tags(text, tags) ⇒ Object
35 36 37 |
# File 'lib/claude_memory/ingest/content_sanitizer.rb', line 35 def self.(text, ) .reduce(text) { |result, tag| tag.strip_from(result) } end |