Mathematica, 101 bytes
If[StringMatchQ[#,("sin"|"si"|"s"|"cos"|"co"|"c"|"tan"|"ta"|"t"|"ln"|"l"|"log"|"lo"|"e")..],"T","F"]&
It seems that the hard parts of this challenge are coming up with the shortest regex and choosing the most concise language to match the regex. I don't have anything to contribute to the former, and Mathematica isn't good candidate for the latter since you have to use StringMatchQ
and RegularExpression
. What I can do is answer your P.S.: is "tasteless" the longest word that you can type?
In[1]:= f=StringMatchQ[#,("sin"|"si"|"s"|"cos"|"co"|"c"|"tan"|"ta"|"t"|"ln"|"l"|"log"|"lo"|"e")..]&;
In[2]:= Select[EntityList@"Word",f@#[[2,1]]&][[All,2,1]]//SortBy[StringLength]//DeleteDuplicates
Out[2]= {c,e,l,s,t,cc,cl,el,et,lo,si,sl,ta,te,ccc,col,cos,cot,eel,ell,eta,etc,lee,let,log,lot,sec,see,set,sic,sin,sit,tae,tan,tat,tec,tee,cell,clog,clot,coco,cole,colt,coss,cost,cote,else,less,loco,loge,loll,lose,loss,lota,sect,seel,sell,sess,seta,sett,sill,silo,silt,sine,sise,siss,site,sloe,slog,slot,stet,taco,tact,tael,talc,tale,tall,tect,tell,test,cello,close,cosec,costa,cotan,eccle,elect,elsin,ettle,loess,lotte,secle,setee,since,sleet,stale,stall,state,steel,stele,tasse,taste,tatee,teest,telco,testa,tetel,tsine,cellco,closet,coleta,collet,coltan,cosine,cosset,costal,ecesis,estate,lessee,scelet,select,sellee,sestet,settee,settle,siesta,silole,stacte,stance,stasis,tallet,tallot,taslet,tassel,tasset,tattle,tectal,teetan,tellee,testee,tsetse,celesta,cessile,cocotte,collect,costate,ecolect,ectasis,electee,sessile,sinless,sitelet,statant,tassell,tastant,testate,coestate,colessee,colocolo,cosiness,costless,electant,lossless,sceletal,siletane,statelet,tactless,tallness,telltale,telocoel,coelostat,sissiness,stateless,tasteless,tattletale}
So "tattletale" seems to be the longest by one character.
1Just to be clear: We output a single, consistent digit or letter of our choice to indicate the word is typeable, and a different, single, consistent digit or letter of our choice to indicate the word is not typeable. Is that correct? – Dennis – 2016-12-04T16:36:10.403
3
The longest word I could find is 10 letters, coelostats.
– Conor O'Brien – 2016-12-04T21:48:10.6231So, is "πe" not a word? – Mr Lister – 2016-12-05T09:15:37.713
@Dennis Ya, more or less. – ghosts_in_the_code – 2016-12-05T14:43:19.773
@MrLister To make the problem simpler, only a-z are allowed in input. – ghosts_in_the_code – 2016-12-05T14:44:05.420
@Dennis Though there's probably nothing wrong in outputting something bigger, like 'true' and 'false' or something like that. Basically it shud be obvious from the output as to what the result is. Ok, I'll edit the question – ghosts_in_the_code – 2016-12-05T14:49:04.290
1Another 11: sissinesses – Chris H – 2016-12-06T13:29:44.233