Python 3, 770(削除) 770 (削除ここまで) 642 bytes
import zlib,base64
A='deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
B=zlibA=zlib.decompress(base64.b85decode(b'c$_7UYjVRd2!yY)S5qWp)5uZ=uru!IySP90V_|rGMa^-E&VNdB;H1S_2f|8290;)j7yV7J%d^Wq23sMpSzu$qo;^u@D9IyHvE~Y_aZ`-##Ee}q7bO~)P3UUc!*KBGJAe35sGn4Dg*q$hg)r7k+@W(Z-3BEF?F-tdS^~S|4-B0443B>&x}e|ad5xF>_ITn*?1VMqLoI4vi7nBIZ6>m-KsG}&MdPkJnYWr$LA@PyH5$<?F;L6Jv~;{Uj}p&oDC6}95|fNJ')).decode('utf-8').split()
g=lambda i:i[:2]=='ei'or i in 'deist.replace('ei','')in'dst heirhr heirshrs heisthst reinrn theirthr theirsthrs theistthst veinvn weirwr bruneibrun loreleilorel nucleinucl taipei'taip'.split()or any(w in i for w in BA)
f=lambda i:'eei'in i or'eii'in i or(not('eie'in i or'iei'in i)and((i in A)or(not(i.replace('ei','0').replaceindex('ie','ei')<i.replaceindex('0','ie')if'ei' in A)i and 'ie' in i else('ie'in i)^g(i.replace('ie','ei')))))
l1 = 'deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
l2l = 'eigh ceiv eing eism eign einv reins reim feit veil seiz neit einf odu eird istic rna igl tera seil eiss reini heists tm rpr isu eip heik dece ceil feint herein fy ido eish nceit ucl rlo olt noe eio dri caf trad rote icat hein iress heife mr ji oly mad iru ifo eia egr cys alb uein reic onot nthe ndee kein isin isan inon iger code cave beig weirs veins veine seine reine deity deists atheist'.split()
def f(i):
if 'eei' in i or 'eii' in i: return True
if 'eie' in i or 'iei' in i: return False
j = i.replace('ei','0').replace('ie','ei').replace('0','ie')
if i'ie' in l1: return True
i ifand j'ei' in l1i: return Falsei.index('ei')<i.index('ie')
# there now can't be 'ei' and 'ie' in i
if 'ei' in i:
return goodei(i)
return not goodei(j)
def goodei(i):
if i[:2] == 'ei': return True
if i in 'brunei lorelei nuclei taipei deist heir heirs heist rein their theirs theist vein weir'.split(): return True
for w in l2l:
if w in i: return True
return False
Python 3, 770 bytes
import zlib,base64
A='deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
B=zlib.decompress(base64.b85decode(b'c$_7UYjVRd2!yY)S5qWp)5uZ=uru!IySP90V_|rGMa^-E&VNdB;H1S_2f|8290;)j7yV7J%d^Wq23sMpSzu$qo;^u@D9IyHvE~Y_aZ`-##Ee}q7bO~)P3UUc!*KBGJAe35sGn4Dg*q$hg)r7k+@W(Z-3BEF?F-tdS^~S|4-B0443B>&x}e|ad5xF>_ITn*?1VMqLoI4vi7nBIZ6>m-KsG}&MdPkJnYWr$LA@PyH5$<?F;L6Jv~;{Uj}p&oDC6}95|fNJ')).decode('utf-8').split()
g=lambda i:i[:2]=='ei'or i in 'deist heir heirs heist rein their theirs theist vein weir brunei lorelei nuclei taipei'.split()or any(w in i for w in B)
f=lambda i:'eei'in i or'eii'in i or(not('eie'in i or'iei'in i)and((i in A)or(not(i.replace('ei','0').replace('ie','ei').replace('0','ie')in A)and('ie'in i)^g(i.replace('ie','ei')))))
l1 = 'deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
l2 = 'eigh ceiv eing eism eign einv reins reim feit veil seiz neit einf odu eird istic rna igl tera seil eiss reini heists tm rpr isu eip heik dece ceil feint herein fy ido eish nceit ucl rlo olt noe eio dri caf trad rote icat hein iress heife mr ji oly mad iru ifo eia egr cys alb uein reic onot nthe ndee kein isin isan inon iger code cave beig weirs veins veine seine reine deity deists atheist'.split()
def f(i):
if 'eei' in i or 'eii' in i: return True
if 'eie' in i or 'iei' in i: return False
j = i.replace('ei','0').replace('ie','ei').replace('0','ie')
if i in l1: return True
if j in l1: return False
# there now can't be 'ei' and 'ie' in i
if 'ei' in i:
return goodei(i)
return not goodei(j)
def goodei(i):
if i[:2] == 'ei': return True
if i in 'brunei lorelei nuclei taipei deist heir heirs heist rein their theirs theist vein weir'.split(): return True
for w in l2:
if w in i: return True
return False
Python 3, (削除) 770 (削除ここまで) 642 bytes
import zlib,base64
A=zlib.decompress(base64.b85decode(b'c$_7UYjVRd2!yY)S5qWp)5uZ=uru!IySP90V_|rGMa^-E&VNdB;H1S_2f|8290;)j7yV7J%d^Wq23sMpSzu$qo;^u@D9IyHvE~Y_aZ`-##Ee}q7bO~)P3UUc!*KBGJAe35sGn4Dg*q$hg)r7k+@W(Z-3BEF?F-tdS^~S|4-B0443B>&x}e|ad5xF>_ITn*?1VMqLoI4vi7nBIZ6>m-KsG}&MdPkJnYWr$LA@PyH5$<?F;L6Jv~;{Uj}p&oDC6}95|fNJ')).decode('utf-8').split()
g=lambda i:i[:2]=='ei'or i.replace('ei','')in'dst hr hrs hst rn thr thrs thst vn wr brun lorel nucl taip'.split()or any(w in i for w in A)
f=lambda i:'eei'in i or'eii'in i or(not('eie'in i or'iei'in i)and(i.index('ei')<i.index('ie')if'ei' in i and 'ie' in i else('ie'in i)^g(i.replace('ie','ei'))))
l = 'eigh ceiv eing eism eign einv reins reim feit veil seiz neit einf odu eird istic rna igl tera seil eiss reini heists tm rpr isu eip heik dece ceil feint herein fy ido eish nceit ucl rlo olt noe eio dri caf trad rote icat hein iress heife mr ji oly mad iru ifo eia egr cys alb uein reic onot nthe ndee kein isin isan inon iger code cave beig weirs veins veine seine reine deity deists atheist'.split()
def f(i):
if 'eei' in i or 'eii' in i: return True
if 'eie' in i or 'iei' in i: return False
if 'ie' in i and 'ei' in i: return i.index('ei')<i.index('ie')
# there now can't be 'ei' and 'ie' in i
if 'ei' in i:
return goodei(i)
return not goodei(j)
def goodei(i):
if i[:2] == 'ei': return True
if i in 'brunei lorelei nuclei taipei deist heir heirs heist rein their theirs theist vein weir'.split(): return True
for w in l:
if w in i: return True
return False
Python 3, 770 bytes
import zlib,base64
A='deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
B=zlib.decompress(base64.b85decode(b'c$_7UYjVRd2!yY)S5qWp)5uZ=uru!IySP90V_|rGMa^-E&VNdB;H1S_2f|8290;)j7yV7J%d^Wq23sMpSzu$qo;^u@D9IyHvE~Y_aZ`-##Ee}q7bO~)P3UUc!*KBGJAe35sGn4Dg*q$hg)r7k+@W(Z-3BEF?F-tdS^~S|4-B0443B>&x}e|ad5xF>_ITn*?1VMqLoI4vi7nBIZ6>m-KsG}&MdPkJnYWr$LA@PyH5$<?F;L6Jv~;{Uj}p&oDC6}95|fNJ')).decode('utf-8').split()
g=lambda i:i[:2]=='ei'or i in 'deist heir heirs heist rein their theirs theist vein weir brunei lorelei nuclei taipei'.split()or any(w in i for w in B)
f=lambda i:'eei'in i or'eii'in i or(not('eie'in i or'iei'in i)and((i in A)or(not(i.replace('ei','0').replace('ie','ei').replace('0','ie')in A)and('ie'in i)^g(i.replace('ie','ei')))))
Ungolfed
l1 = 'deified deifies deities eighties eightieth inhomogeneities weightier weightiest'.split()
l2 = 'eigh ceiv eing eism eign einv reins reim feit veil seiz neit einf odu eird istic rna igl tera seil eiss reini heists tm rpr isu eip heik dece ceil feint herein fy ido eish nceit ucl rlo olt noe eio dri caf trad rote icat hein iress heife mr ji oly mad iru ifo eia egr cys alb uein reic onot nthe ndee kein isin isan inon iger code cave beig weirs veins veine seine reine deity deists atheist'.split()
def f(i):
if 'eei' in i or 'eii' in i: return True
if 'eie' in i or 'iei' in i: return False
j = i.replace('ei','0').replace('ie','ei').replace('0','ie')
if i in l1: return True
if j in l1: return False
# there now can't be 'ei' and 'ie' in i
if 'ei' in i:
return goodei(i)
return not goodei(j)
def goodei(i):
if i[:2] == 'ei': return True
if i in 'brunei lorelei nuclei taipei deist heir heirs heist rein their theirs theist vein weir'.split(): return True
for w in l2:
if w in i: return True
return False
The basic idea is that most of the time, if 'ie' is in the word, then it's a real word. So the code first gets rid of cases where there are both ei and ie in the word, and then checks if the word (with ie's replaced with ei's) is a real word.
The way it checks if a word with ei is a real word, is it uses a big list of strings that are present in only real words.