Gap solitons in almost periodic one-dimensional structures