Coder Social home page Coder Social logo

textprocessor's Introduction

TextProcessor

文本预处理器 输入: 运行程序,输入文本预处理器需要处理的文本字符串text,排版宽度width。 输出: 排版过后的字符串result。

测试用例: 请输入需要预处理的文本: The main theme of education in engineering school is learning to teach yourself 请输入排版宽度: 30 输出: The(1); (1);main(1); (1);theme(1); (1);of(1); (1);education(1); (1);in(1); (2);engineering(2); (2);school(2); (2);is(2); (2);learning(2,3); (3);to(3); (3);teach(3); (3);yourself(3); 请输入需要预处理的文本: So many whitespaces 请输入排版宽度: 10 输出: So(1); (1);many(1); (1);whitespaces(2,3);

构建运行思路: 1.获取文本字符串text进行遍历 2.按排版宽度width依次对文本字符串进行拆分为n段 3.依次获取每个段内每个节的首尾位置,判断该节是否跨两行,并对该节进行遍历输出

textprocessor's People

Contributors

hu-ao avatar huaoao 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.