I would just add all the solutions here it are counting words in a title or
string or the text field. None are attempting to render the tiddler first
so that lists transclusions and macros etc.. are first expanded.
You can use the wikify widget to wikify the result into a variable and pass
Thank you very much,
both work, also one more question , to get anywhere remotely close to
writing code like this for tiddly wiki , what language should i try to
learn, i have no coding skills, and was just wondering if i would invest my
time in learning a bit, what language should i be
actually, https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText is
very confusing! It took me a lot of time to make any sense out of it for
the special case like using <<< and after my own tests, I have failed to
see that as useful.
Your code is actual code and it would be good to use it
Hi Jean-Pierre
> You made an error in your macro, Jeremy. You should have used $arg$ instead
> of .
It's actually not an error: it's an alternative way to access the parameters of
macros. It avoids the problem that otherwise the code would fail with a tiddler
title containing a closing square
You made an error in your macro, Jeremy. You should have used $arg$ instead
of .
Thus your code would be
\define count-words(title,word)
<$text text={{{ [[$title$]get[text]split[$word$]count[]subtract[1]] }}}/>
\end
But it is false nonetheless because it would, for example, cut word "totem"
Another technique is to use the “split” operator to split the string by the
word:
\define count-words(title,word)
<$text text={{{ [<__title__>get[text]split<__word__>count[]subtract[1]] }}}/>
\end
<>
Using the splitregexp operator instead allows would allow splitting case
insensitively, which
Hi ,
is there a way to count the number of occurrences of a specific word in a
tiddler
I have serached , but could only find a plugin that counts the total number
of words, or total number characters.
--
You received this message because you are subscribed to the Google Groups
7 matches
Mail list logo