move filter and extract from segment.cpp/h to keywordext.cpp/h