Sentence:  He had not even thought about her much except once or twice at night in bed when his slowly ranging thoughts would abruptly , <WSD>almost</WSD> accidentally , encounter her . 
Meaning of the word marked with <WSD> tags:  (of actions or states) slightly short of or not quite accomplished; all but