Giter Club home page Giter Club logo

compare-text-similarity's Introduction

compare-text-similarity

a tiny Java program for comparing text similarity

程序功能

本程序能够比较两个DOC文档的相似性,可以统计出两个文档之间中有多少相同字符,多少不同字符,并且能够统计出前10个高频字词。

实现环境

语言:Java

依赖包:使用了 poi-scratchpad 的jar包和相关依赖包,另外导入了poi-ooxml 的jar包以实现 .docx 文件的读取。

详细描述

首先,创建File类来存储文件text1.doc和text2.doc(后文以文件a和b表示)的文件内容。然后使用ArrayList动态数组来根据需要存储各种类型的字词,如使用same保存a和b中相同的字词,diffa和diffb分别保存a和b中不同的字词(不重复)。至于相同与不同字词的分类保存,只需利用循环遍历字词,并加一个判断即可。

compare-text-similarity's People

Contributors

bright-hsu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.