Git Product home page Git Product logo

Comments (6)

tushuhei avatar tushuhei commented on May 6, 2024

Hi! Could you clarify what the fixed line means with some examples? What's the ideal output expected?

from budoux.

wanghaisheng avatar wanghaisheng commented on May 6, 2024

never mind ,I managed to that.for example as following.
default as this

echo $'本日は晴天です。\n明日は曇りでしょう。' | budoux
本日は
晴天です。
---
明日は
曇りでしょう。

what I want is fixed line let say 2 because I want to limit words/characters in each line ,then I cal and join the first and last 3 line into new line
@tushuhei

from budoux.

tushuhei avatar tushuhei commented on May 6, 2024

Hmm, sorry I think I need some more clarification.
What is the ideal output for the command echo $'本日は晴天です。\n明日は曇りでしょう。' | budoux with the parameter you want to have?

from budoux.

wanghaisheng avatar wanghaisheng commented on May 6, 2024

since i really dont know japanese ,perhaps this text example isnt that proper, my case is i want to cut long paragpraph into small ones without cutting from middle of sentence, i found your lib is kinda of can do this job.
my idea came into first get raw output of budouX,then line by line count the total words ,

from budoux.

tushuhei avatar tushuhei commented on May 6, 2024

Yes, BudouX can be used to separate a long paragraph into a series of phrases.
If you're interested in counting the phrases (or words) in total, I believe you can get the desired results using sed and wc like this:

echo $'本日は晴天です。\n明日は曇りでしょう。' | budoux -d='' | sed  '/^$/d' | wc -l

from budoux.

tushuhei avatar tushuhei commented on May 6, 2024

Closing this bug for now, but feel free to reopen if anything.

from budoux.

Related Issues (20)

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.