Complicating things?

So basically what im trying to do is ...

Open file, read that file, than try to find ..

We or we and replace them with I, but not replace the cases where words contain We or we, such as Went, went, etc

a and replace them with the, but not replace the cases where words contain a, such as ability, apparent, etc

A and replace them with The, same for this ...

If it were a simple replace, id just getline, and find the We, and just replace it with I but i cant just do that, can i?

If this wasn't a homework question, you would just use sed, wouldn't you?