Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

456 B
Raw Blame
export function parseTextExtra(_text, hashtags) {
    return hashtags.map((h) => ({
        type: 1,
        hashtag_id: h.id,
        hashtag_name: h.name,
        start: h.start,
        end: h.end,
        caption_start: 0,
        caption_end: h.end - h.start,
    }));
}
/** Extract hashtag names from text (e.g. "#话题" → ["话题"]) */
export function extractHashtagNames(text) {
    return [...text.matchAll(/#([^\s#]+)/g)].map((m) => m[1]);
}