=LAMBDA.APPLY(TEXTSPLIT(TEXTJOIN(".",1,Attested Words in Pre‐Proto Languages::C2:C360),,".",1),LAMBDA(syls,LAMBDA.APPLY(UNIQUE(syls),LAMBDA(uniqs,SORT(MAKEARRAY(ROWS(uniqs),2,LAMBDA(r,c,IF(c=2,COUNTIF(syls,"="&INDEX(uniqs,r,1)),INDEX(uniqs,r,1)))),2)))))

=LET(words,Attested Words in Pre‐Proto Languages::C2:E360,LET(syls,SORT(TEXTSPLIT(REDUCE("",SEQUENCE(ROWS(words),1),LAMBDA(str,rn,str&REDUCE("",TEXTSPLIT(IF(ISBLANK(INDEX(words,rn,3)),IF(ISBLANK(INDEX(words,rn,1)),".",INDEX(words,rn,1)),INDEX(words,rn,3)),,".",1),LAMBDA(instr,s,instr&s&"@"&rn&".")))),,".",1)),LET(uniqs,UNIQUE(MAP(syls,LAMBDA(syl,TEXTBEFORE(syl,"@")))),SORT(SORT(MAKEARRAY(ROWS(uniqs),3,LAMBDA(r,c,LET(syl,INDEX(uniqs,r,1),LET(wrstart,XMATCH(syl&"@*",syls,2,1)-1,wrend,XMATCH(syl&"@*",syls,2,-1),SWITCH(c,2,COUNTIF(syls,"="&syl&"@*"),3,REDUCE("",TAKE(DROP(syls,wrstart,0),wrend-wrstart,1),LAMBDA(acc,wr,IF(acc="",acc,acc&" | ")&INDEX(words,TEXTAFTER(wr,"@"),2))),syl))))),1),2))))

@aescling @Lady Excel, but also arguably written more as a one-liner than as something intended to be maintainable.

Follow

@aschmitz @aescling technically i am using Numbers so i make no portability guarantees

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.