I have modified my algorithm for deriving a Hebrew root from a word of text. It used to remove letters that could never be removed! It no longer does. I made it a rule that non-grammatical letters cannot be removed just because part of the word matches a root! And it did not know about pronouns as objects before - now it does. Like our primitive brain stem, the old algorithm is still embedded in the new.
I just do one word at a time. And I have not yet figured out how to restore disappearing letters that or letters that transform themselves in the construct. I let the algorithm see Job, Psalms, and Lamentations and look at the frequency of letters in roots. Notice how many words have a root beginning with aleph or ayin. (Now it is true that any lexical word beginning with ayin also has a root beginning with ayin.) And how many have a root ending in resh. And lamed wins as the middle letter!