Vertical line/pipe character | is counted as a word by word count

Description

Steps to reproduce

  1. Log in

  2. Post > New Work

  3. Fill in required fields

  4. For the work text, enter one of the following: "foo bar |", "ab cd|ef", or "||||||||||"

  5. Post

What happens
Setting the text of the work to "foo bar |" results in a word count of 3, setting it to "ab cd|ef" results in a word count of 4, and setting it to "||||||||||" results in a word count of 10.

What should happen
Setting the text of the work to "foo bar |" should result in a word count of 3; setting it to "ab cd|ef" should result in a word count of 3, and setting it to "||||||||||" should result in a word count of 0.

Deploy notes

We need to run bundle exec rake After:reset_word_counts which recomputes word counts for every work.

Activity

Show:

Brian Austin 
January 29, 2024 at 11:07 PM

Ran the rake on prod. It took over 30 hours, and my laptop eventually just killed the connection, but at that point over 90% of works had been processed which I think is good enough.

Brian Austin 
May 29, 2023 at 11:53 AM

Posted https://test.archiveofourown.org/works/1081531 with the content

and observed that the word count is 4, as expected.

Runt 
May 29, 2023 at 11:17 AM

word count working as expected:

 

 

resulted in word count 5 (foo bar (2), ab cd ef (3))

only posting the line of pipes resulted in 0 words.

Done

Details

Assignee

Reporter

Roadmap

Works

Priority

Affects versions

Fix versions

Components

BackEnd

Difficulty

Milestone

Sentry

Created January 13, 2022 at 12:31 AM
Updated January 29, 2024 at 11:07 PM
Resolved January 29, 2024 at 11:07 PM