The paper proposes an algorithm which can implement ICD-10 coding automatically for clinical diagnoses in Chinese and calculate the semantic similarity of texts by the calculation method of distributed semantic similarity. In consideration to the linguistic features of Chinese, it constructs term vectors based on both words and Chinese characters and tests their influences on the precision ratio and recall ration. The results indicate that this algorithm has a higher precision ration in the test set.