I have recently been reading about Error Correction for a job interview and have written a number of programs that use n-ary BCH (Bose, Chaudhuri, Hocquenghem) cyclic codes and have now written a script that will generate phone numbers once given an "area code" for a given user (encoding) and will decode it and will repair up to two errors (and detect more).
I would like to now be able to repair one of the phone numbers given if it is missing some digits (two seems doable). After researching ISBN codes it appears that it is possible to repair a ISBN code if two random digits have been removed.
In your Decoding class you state that the syndrome digit determine whether there is an error or not. Why not replace the two missing digits with
x
andy
and change them throughout the number to find every possible space for them where each syndrome digit is 0?The problem is finding the location of these errors. As you've stated, just sticking in digits left, right and centre won't really do much as it'll return the wrong codes.