Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

ivkeMilioner
ivkeMilioner

Posted on • Edited on

     

How to count phrases in text with JS?

I am beginner and I cannot find any source to see how to JavaScript count phrases in text. I know how to count charters, words and sentence.

Top comments(4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
savagepixie profile image
SavagePixie
Always learning new things. I love web development and coding in general.
  • Joined

I'm not sure you can without complex algorithms, as there's really no punctuation to mark them. Why do you need to count phrases?

CollapseExpand
 
ivkemilioner profile image
ivkeMilioner
  • Location
    Beograd
  • Joined

Just want to add something to my project.

CollapseExpand
 
savagepixie profile image
SavagePixie
Always learning new things. I love web development and coding in general.
  • Joined

Let me make sure I understand what you mean by phrase. Are you trying to achieve something like this:

The house at the end of the street is red. | |- NP: The house at the end of the street |   |- PP: at the end of the street |       |- PP: of the street |- VP: is red

Or are you using phrase in any other way? Perhaps you could provide an example of what exactly you want to achieve?

Thread Thread
 
ivkemilioner profile image
ivkeMilioner
  • Location
    Beograd
  • Joined

The house at the end of the street is red.
Car is red.
Book is red.

phrase = is red

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Beograd
  • Joined

More fromivkeMilioner

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp