From: Jean Louis <bugs@gnu.support>
To: Christopher Howard <christopher@librehacker.com>
Cc: Help Gnu Emacs Mailing List <help-gnu-emacs@gnu.org>
Subject: Re: Org tag generator?
Date: Thu, 26 Dec 2024 23:44:21 +0300 [thread overview]
Message-ID: <Z23AJSV_-RduneGM@lco2> (raw)
In-Reply-To: <87r05xf3bb.fsf@librehacker.com>
* Christopher Howard <christopher@librehacker.com> [2024-12-24 19:35]:
> Now you are recommending a system whereby I myself have to manual
> recognize and record all specific words that lead me to assign a
> specific tag. This works, in a sense, but does nothing to reduce my
> work load. There might be, for example, thousands of plant-related
> words that lead me to apply the tag :botany:. I don't want to have
> to figure out what those words are specifically and make a record of
> them. I just want to intuitively apply the tag :botany: and then the
> software figures out, after observing many nodes, that the words
> "rainforest" or "flower" or should generate the tag :botany:.
I have found deterministic way of getting keywords by using some
manual preparation.
I am using PostgreSQL database, and I am aware that this may sound
hard, though is not.
Full documents could easily be imported into PostgreSQL, and then
tsvector for full text search generated.
I have done that.
I have table hyobjects, with hyobjects_tokens, containing tsvector
type for English (or other language).
Let us say I need some 2 words terms from database, by their ranking,
then it is breeze:
SELECT 'Ugandan ' || sub_words[1] AS term, COUNT(*) AS count
FROM hyobjects
CROSS JOIN LATERAL regexp_matches(hyobjects_text, '\mUgandan\s+([a-zA-Z]+)', 'g') AS sub_words
WHERE NOT EXISTS (
SELECT 1
FROM stopwords
WHERE LOWER(stopwords_name) = LOWER(sub_words[1])
)
GROUP BY sub_words[1]
ORDER BY count DESC;
term | count
----------------------+-------
Ugandan company | 82
Ugandan shillings | 58
Ugandan coffee | 26
Ugandan miners | 12
Ugandan people | 12
Ugandan shilling | 8
Ugandan Coffee | 8
Ugandan gold | 7
Ugandan Constitution | 6
Ugandan government | 6
I like this very deterministic way, so I will use it for automatic
referencing and tagging for easier sales and marketing purposes.
If you happen to need help to generate keywords this way, I am 😄
available.
--
Jean Louis
prev parent reply other threads:[~2024-12-26 20:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 16:39 Org tag generator? Christopher Howard
2024-12-20 12:14 ` Jean Louis
2024-12-23 17:23 ` Christopher Howard
2024-12-23 20:21 ` Jean Louis
2024-12-24 16:34 ` Christopher Howard
2024-12-24 20:47 ` Jean Louis
2024-12-26 20:44 ` Jean Louis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z23AJSV_-RduneGM@lco2 \
--to=bugs@gnu.support \
--cc=christopher@librehacker.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.