Using regular expressions, I'm trying to detect conditional clauses in sentences. In cases where the sentences starts with the conditional clause and the comma is correctly present (e.g., "If I see a snake, I run."), this is reasonably straightforward.
However, I have problems in cases there the conditional clause is in the end. For example, I can rewrite the previous example as
I run if I see a snake
where there is not comma. Now, there are also sentences such as
I wonder if I passed the test I'm not sure if I passed the test
Is there a straightforward way to tell using (simple) rules that the second sentence does not contain a conditional clause?
Intuitively, if I can replace
whether, then it's not a conditional clause. But how could I tell that an algorithm that the new sentence is still correct?
In case it helps: I have for each word the Part-of-Speech tag, and should be able to get the tense of each verb.