KinoSe...:Token(3pm)
β¨ NAME β¨
KinoSearch1::Analysis::Token β the itty-bitty unit of text, bestie π
(and yeah, this is from the User Contributed Perl Documentation for KinoSearch1::Analysis::Token(3pm) β that's the whole title, we're just vibing with it) π
π¦ SYNOPSIS π¦
# private class - no public API
That's it. That's the whole thing. She's mysterious, she's exclusive, she's not for you π
π PRIVATE CLASS π
Okay so real talk: you literally cannot instantiate a Token object at the Perl level. Not a thing. Not allowed. She's not taking walk-ins π«
BUT β and this is the plot twist β you can still affect individual Tokens inside a TokenBatch by way of TokenBatch's (experimental) API. So like, you can't date her directly, but you can absolutely influence the friend group π
πΈ DESCRIPTION πΈ
Token is the fundamental unit used by KinoSearch1's Analyzer subclasses. The main character of the text-processing world, honestly π Every single Token has 4 attributes: text, start_offset, end_offset, and pos_inc (which stands for position increment, iykyk).
The text of a token is a string. Simple. Elegant. Slay.
A Token's start_offset and end_offset locate it within a larger text β and here's the part that ate: this holds true even if the Token's text attribute gets modified. By stemming, for instance. π
So picture this: the Token for "beating" in the text "beating a dead horse" begins life with a start_offset of 0 and an end_offset of 7. Then stemming happens, the text becomes "beat", but the end_offset is still 7. She kept receipts. The glow-up doesn't erase the origin story π
Now, the position increment π β it defaults to 1 β and it's an advanced tool for manipulating phrase matching. Like, this is the graduate-level syllabus, ngl.
Ordinarily, Tokens get assigned consecutive position numbers: 0, 1, and 2 for "three blind mice". Cute, orderly, fine.
However!!! If you set the position increment for "blind" to, say, 1000, then the three tokens will end up assigned to positions 0, 1, and 1001 β and will no longer produce a phrase match for the query '"three blind mice"'. π
Periodt. That's the whole trick. You broke the phrase match on purpose and you meant to do it. Main character energy fr fr.
π COPYRIGHT π
Copyright 2006-2010 Marvin Humphrey π«Ά
π LICENSE, DISCLAIMER, BUGS, etc. π
See KinoSearch1 version 1.01. π§
okay that's the whole page, you made it, I'm so proud of you ππ
this was rendered from perl v5.42.3, dated 2026-08-20 β shoutout to the toolchain, she's doing her best πΈ
bye bestie, go tokenize something iconic β¨ππ
π¦ where this page comes from
- ubuntu stonking: libkinosearch1-perl 1.01-6build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms