An improved K-nearest-neighbor algorithm for text categorization