Fields as Lists of Tags

110 views
Skip to first unread message

Aidan Grey

unread,
Jul 18, 2019, 12:43:38 PM7/18/19
to TiddlyWiki
Can someone ELI5* how to use / work with fields as lists of tags? What are the limitations and methods for using them?

I understand that you can use buttons to edit the list, thanks to the listops widget (I think it's a widget), but I don't understand how it all goes together. Is it really just create a field and put items in it, like this?

partofspeech: N:IN V:Tr22 V:Di12 Part:Case

where V:Tr22 is a whole "tag" that I can subject to filters like [prefix[V:Tr], [suffix[22], and so forth?

I'm particularly interested because I have fields in a dictionary TW that really should have multiple items, like part of speech above. A word can be a noun, several kinds of verbs, and an adverb, for example, and ideally, I'd like to be able to tag them all in there, filter on the tags in the field, etc. In other words, treat them just like a list. They wouldn't change a lot and I don't really need the tags visible since they're in the dictionary entry. I just need them for filtering.

I also think using fields this way might be a way to solve another issue - some tags I don't want visible on certain kinds of tiddlers, but the solutions I've seen so far have been ... aesthetically unappealing to me ($:/ will work for some, but not all of them). Multicol dropdowns are great, but when I have literally 100 tags, it's impossible.

Thanks,
Aidan

* just in case, ELI5 = Explain Like I'm 5

Mark S.

unread,
Jul 18, 2019, 2:02:54 PM7/18/19
to TiddlyWiki
Using a field like that is possible, with the operators that work with lists.

As a starter, you will want to convert your list field into a title list. There are two main approaches

* Method 1

<$list filter="[enlist{TestData!!mylist}prefix[V:]\"/>

* Method 2

<$list filter="[list[TestData!!mylist]jprefix[V:]]"/>

You may also want to use the "contains" operator

<$list filter="[title[TestData]contains:mylist[V:Tr22]]"/>

The contains operator looks for the whole value in the list field.

Which brings me to a larger point about database design. Although it's initially convenient
to make designations like "V:Tr22", it can lead to headaches down the road. It might be better to
have each word in it's own tiddler and it's qualities identified separately, e.g.

wordtype: V
verbtype: TR
verbvalue: 22

(I didn't know what the 22 represented).

In database parlance, this is know as "data atomization" -- having each field do just one job. You can look up
"data normalization" to learn more about it. It makes creating reports and data extractions easier down the road.

If you do it this way,  you can use existing filter operators to list all of your transitive verbs sorted by verb value without having to split the field into it's sub-components.

Good luck!

Aidan Grey

unread,
Jul 18, 2019, 3:19:51 PM7/18/19
to TiddlyWiki
Thanks Mark! 

Ultimately, what I need is some way to hide / not display certain tags. Fields seemed like the way to do it, but maybe not.

As you'll see below, if I tag everything the way I need, my tag "cloud" will be like 3 inches long, and that's way too much. I tried the whole $:/ trick I found in my googles, but that didn't work - they were still visible.

I'd like to see SOME tags, specific ones, but all 4589 that apply... no thanks. I think I could remove the whole tag display field and then make my own, maybe, that gets filtered for the stuff I want to see only?


If I understand right, I'd have my fields

partofspeech: V:Tr11 N:IN V:In1 V:St V:Tr12:Caus:Ins
semanticdomain: 31201 60512 80403 70600 
          a code for generic semantic domains that the word would fit into, to make vocab gathering easier, and to make education easier as well
          all the colors are in one semanticdomain code, for example, and 31201 is the code for frogs and related vocab

and then, when I want to filter by that field, I just use the enlist. So if I wanted to list all the Transitive verbs about frogs (partofspeech = V:Tr and semanticdomain = 31202), how would i do that?

If I just used tags, it would just be filter="tag[V]tag[Tr]tag[31201]]" - easy.... except for the 3 inches of tags :)


As to atomization - I already tried that and got halfway in before I realized it wouldn't work for me. It gets complicated:

Go 1
1. Intransitive Verb: move; attack; be known; empty the bladder or bowels
2. Transitive Verb: afford; proceed along
3. Noun: act of going; a turn
4. Adjective: functioning properly and ready (all systems go)

Go 2
1. Noun: Japanese board game

For me, that's 2 separate tiddlers, one for the english word go, one for the japanese word borrowed into english

the English one, though, has 4 different parts of speech, Intr. Verb, Tr Verb, Noun, and Adjective. For some words/languages, it won't stop there - there can be multiple kinds of intransitive verbs, and so on. Unless I make a separate tiddler for every distinct sense / use of a word (which is too much), I couldn't use the atomized approach. There are contexts it's good for, but unfortunately this isn't one of them.

And to satisfy the curiosity: this is for a polysynthetic language, which has different classes or person markers. 22 indicates that the verb uses class 2 markers for both subject and object. 12 indicates class 1 for the subject, 2 for the object. And so on. 

On that point, because it's polysynthetic (gloms a lot of stuff into the verb), it's entirely possible to have even more complex details: V:Tr11:DirIns:Caus:AppBen is a causative transitive verb, with directional and instrumental, and a benefactive. An example of this might be:

 "she killed it for him by (throwing/stabbing) a knife into it"

She = the first 1 of 11
kill = causative of die: she made it die 
it = the second 1 of 11
Dir = Directional = into the middle of
Ins = Instrumental = with a knife
AppBen = Applicative (Benefactive) = for him/her

Hopefully the reason for field lists and/or hidden tags is much more apparent.

Aidan Grey

unread,
Jul 18, 2019, 4:28:08 PM7/18/19
to TiddlyWiki

After some thought and digging, a better idea.

I can go into $:/core/ui/ViewTemplate/tags and change the filter list to prevent certain tags / kinds of tags from showing in the tag wrapper. They'll still be on the tiddler, just not shown. 

Unfortunately, that would be a giant list - are there limits on how large a filter can be? Is there a way to transclude the tag list or something?

If I need to see them again - I can either restore the original filter or go to the tiddler manager and edit from there.

Mark S.

unread,
Jul 18, 2019, 4:29:09 PM7/18/19
to TiddlyWiki


On Thursday, July 18, 2019 at 12:19:51 PM UTC-7, Aidan Grey wrote:

As to atomization - I already tried that and got halfway in before I realized it wouldn't work for me. It gets complicated:

Go 1
1. Intransitive Verb: move; attack; be known; empty the bladder or bowels
2. Transitive Verb: afford; proceed along
3. Noun: act of going; a turn
4. Adjective: functioning properly and ready (all systems go)

Go 2
1. Noun: Japanese board game

For me, that's 2 separate tiddlers, one for the english word go, one for the japanese word borrowed into english

Yes --  those are two different words that happen to share a similar sound.. You could use the caption or description field so that they
could share the title "Go" for sorting and searching.

Actually Go 1 would need to be split into each meaning. (Go (bodily function), Go (movement), Go (turn)...) One for each entry in a good dictionary -- assuming that you will want to use the data in some manner.

But sometimes it's better to work backwards. What outputs do you want?  How do you expect to use this data?

If you could hide tags, what tags would you hide?

Hmm. Will your polysynthetic language have a single word that indicates all those things? Are these words you will be constructing? Or are you trying to classify existing words?

Good luck!

Mark S.

unread,
Jul 18, 2019, 4:33:35 PM7/18/19
to TiddlyWiki
You could insert the "subfilter" operator. Then use transclusion subfilter{MyTiddlerWithAVeryLongFilter} and change the contents of MyTiddlerWithAVeryLongFilter as you needed on the fly.

If there's a limit to filter run size, I haven't hit it yet ;-)

Aidan Grey

unread,
Jul 18, 2019, 5:18:46 PM7/18/19
to TiddlyWiki
HHOLY MOLY!!

 I think that's it!! Thank you!!

I will let you know what I find when I try to implement / test. 

In the meantime, your other questions:

Yes --  those are two different words that happen to share a similar sound.. You could use the caption or description field so that they could share the title "Go" for sorting and searching.

They'll get superscripts, which is how most dictionaries treat homophones like this.

Actually Go 1 would need to be split into each meaning. (Go (bodily function), Go (movement), Go (turn)...) One for each entry in a good dictionary -- assuming that you will want to use the data in some manner.

Generally, dictionaries list meanings, but don't separate them. All the meanings of go (NOT the game), for example, are generally listed in one entry: https://www.merriam-webster.com/dictionary/go

A sample of my current template, modeled on teanglann.ie (I speak Irish):

# ''tree'' (N:AS)
#* ~ ''mera'': tree chosen for a treehouse
#* ~ ''daunhe'': tree inhabited by giant spiders
# ''family'' (N:CO)
#* ~ ''wai'': extended family; specifically refers to all blood relatives descended from a single great-grandmother 
# ''rope ladder'' (N:LF)

What outputs do you want?  How do you expect to use this data?

The thing is I think tags would be easier, but I don't wanna see all of them. Just in my short example above, there would be the following tags, if I did it the atomic way tag-wise: 

N AS CO LF  20000 20500 60000 60600 60601 30000 32100 32160 50000 51800 51824 ... 

and that's not even all of them. That's a super simplified example, and all are nouns. There are words with TONS of meanings (like English "do"), that fall into a zillion semantic domains. Having those tagged is good, but seeing a huge list of number is not awesome.

If you could hide tags, what tags would you hide?

all the semantic domain tags (hundreds depending on how detailed I get - and I don't plan to get super detailed, but already have ~200), all the part of speech tags (50-100), various markers (past tense, plural, etc. ~200)
 
Hmm. Will your polysynthetic language have a single word that indicates all those things? 

Ah, here's the fun part about polysynthetic langs! :) 

So yeah, because a polysynthetic word is built up from lots of pieces, some of which are mandatory, the "parts" that I'm creating aren't words most of the time. No more than -ed is a word. I mean, you can't just say "I ed the other day"- there's got to be a verb in there. I walked or I barfed or whatever. 

In this language, verbs of handling, like pick up or set or throw, all require a class marker which comes before the verb part. The verb for "picking up a container of something" is a different word in a totally different place in the dictionary than the verb that means "pick up a squirmy puppy", and a sleeping puppy is a different word too!

That example with the "killing it for him" is a couple pieces , built on what would be under the verb "stab", which would be a not-transparent conglomeration of "make die with a knife".  An example: 

die : bash  >>  make die : tosh  >>   make die with a knife : girosh   >>   I stabbed it : ngirotse

All that happened by perfectly regular, but not obvious, sound changes. Dang I love polysynthesis :) 

Bash (die V:In2), Tosh (kill V:Tr11), Girosh (stab V:Tr11) are all related, but different words.

Are these words you will be constructing? Or are you trying to classify existing words?

Yes. I am constructing them ( a la Esperanto / Klingon / Na'vi / Dothraki / Elvish / Etc.). 

Yes, I need to classify existing words. And the semantic domain stuff helps - easier to think of / create all the words related to frogs all/mostly at once.

TonyM

unread,
Jul 18, 2019, 7:58:01 PM7/18/19
to TiddlyWiki
Quicky

Mario's alt tags plugin provides the ability to have multiple tag fields almost as rich as the standard tags field. Sounds like an ideal fit for this use case.

Tony

Aidan Grey

unread,
Jul 18, 2019, 8:23:21 PM7/18/19
to tiddl...@googlegroups.com
Thanks Tony. Unfortunately, I can’t seem to find it anywhere. Do you have a link, or can you provide a copy?
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c60e7bd4-d798-4c25-9d9d-12c0eb9600e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aidan Grey

unread,
Jul 18, 2019, 9:02:36 PM7/18/19
to tiddl...@googlegroups.com
Mark,

We should call you St. Mark of Tiddlywiki, cause you provide all the helps that are belong to you.

The Subfilter is EXACTLY what I wanted, and it worked perfectly. EXACTLY PERFECTLY!!

THANK YOU!

How I tested:

1. test tiddler, with tags ack, bll, haa, woo, kra, and yay
2. ignore tiddler, with contents:

!! the list of these things
ack 
bll
<!--another block of stuff -->
kra

3. changed $:/core/ui/ViewTemplate/tags like this:

filter="[all[current]tags[]!subfilter{ignore}sort[title]]"

4. and voila - only see haa woo and yay on the test tiddler




--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages