I before E, except after C You may be aware of the famous old rhyme, &quot;I before E, except after C&quot;. It is a rule taught to aid in the spelling of certain English words.
Quoting Wikipedia:

If one is not sure whether a word is spelled with the digraph ei or ie, the rhyme suggests that the correct order is ie unless the preceding letter is c, in which case it is ei.

It is well known that this rule is not always correct (e.g. weird, leisure, ancient). That is why you will be asked to write an algorithm which accurately determines the spelling of these words.
Task
The following wordlist (found here) consists of 2967 valid words, each of which contains either ei or ie as a substring.
The input is a single word \$ w \$ from the wordlist, but the ies and eis may be flipped (all occurrences of ie are replaced with ei, and vice versa). You are to output a boolean value indicating whether \$ w \$ was flipped. The values do not need to be True and False, so long as they are consistent. Your program must work correctly for all words, including their flipped counterparts (for a total of 5934 cases to consider). Here I've provided of a list of all possible test cases.
Note that you are not given this list as input. You must find a way to determine, for any word in the list, whether or not it is flipped but you cannot take the list itself as input.
Just to clarify, no word in the wordlist contains iei or eie as a substring, nor do a word and its flipped version both exist in the wordlist. As such, these ambiguous cases do not need to be considered. However, words such as friendlier or eighties which contain more than one occurrence of ei or ie do exist in the wordlist, in which case both occurrences are flipped (friendlier -&gt; freindleir, eighties -&gt; ieghteis).
Since this is code-golf, the shortest code in bytes wins.
As a side note, simply applying the &quot;I before E, except after C&quot; rule will be correct for 4954/5934 of the cases.
JavaScript (ES6), 338 bytes
A regex-based solution. This can probably be optimized some more.
Returns 0 (not flipped) or 1 (flipped).
w=&gt;/dief|egh|etei|it?ei/.test(w)|/^(a?th0[rs]|d0st|r?0|h0r?[1s]|w0r)|b0[gt]|c0(l|t[es1]|v)|cl01|d0(f|n[1es]|ra|tie|ty)|0([aijop]|c1|[df]o|g[hln]|na?[fgor]|rlo|[rs]u|s[ahims]|tf|tm)|f0n?[at]|g0g|h0(fe|k|n|re)|ip01|k0n|n0t|no?th0|o0s|r0n1|rel01|rg0st|s0(l|ne|z)|t0n[es1]|u0n|un01|v0(l|n[1es])|yth0/.test(w.replace(/ei|ie/,0)+1)^/ei/.test(w)

Try it online!
(The total number of errors is reported in the Debug section of TIO, so you can collapse the Footer and Output sections if you just want to see that.)
How?
We first get rid of a few edge cases with the following regular expression:
/dief|egh|etei|it?ei/

which matches these flipped inputs (for which it's especially hard to tell that they are indeed flipped):
diefeid, diefeis, ieghteis, ieghteith, inhomogenieteis, pompiei, soceiteis,
wieghteir, wieghteist

Otherwise, we replace the first occurrence of either ei or ie in the input word with 0 and append a trailing 1:
w.replace(/ei|ie/, 0) + 1

We test whether the resulting string is matched by a large regular expression consisting of 23 patterns which are associated to words for which 0 must be ei.
Examples:

ath0stically1 is matched by ^(a?th0[rs]|d0st|r?0|h0r?[1s]|w0r)
rec0ved1 is matched by c0(l|t[1es]|v)
mad0ra1 is matched by d0(f|n[1ens]|ra|tie|ty)
ineffic0ncy1 is not matched by any expression