Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4025204
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:49:03+00:00 2026-05-20T10:49:03+00:00

This is the current text that i’ve but the regex isn’t correct to split

  • 0

This is the current text that i’ve but the regex isn’t correct to split the sentences correction. please help to correct my regex, thank you.

import nltk
import os, sys, re, glob
from nltk.tokenize import RegexpTokenizer

jp_sent_tokenizer = nltk.RegexpTokenizer(u'[^ 「」!?。]*[!?。]')

para = []
para.append (jp_sent_tokenizer.tokenize(u' 「オタ」とも呼ばれているこのペラナカン(華人)の特製料理は、とてもおいしいスナック料理です。これは、ココナッツミルクやチリペースト、レモングラス、ガーリックと一緒に魚を砕き、それを、蒸して柔らかくしたバナナの葉に包んで炭火で軽く焼いた料理です。このレシピは、アジアの数地域で知られています。「オタオタ(otak otak )」は、マレー語で「脳」を意味します。この「オタオタ」という名前は、この料理の柔らかくトロリとした食感から由来しています。魚を使ったオタオタが、最も一般的ですが、エビやイカ、カニ、魚の頭などを用いたものなど、そのバリエーションは豊富です。 ')

for index in range(len(para[0])):
          print para[0][index]
          print 'this is eos'
          #print line
print 'this is eop'

I’m getting this output:

とも呼ばれているこのペラナカン(華人)の特製料理は、とてもおいしいスナック料理です。
this is eos
これは、ココナッツミルクやチリペースト、レモングラス、ガーリックと一緒に魚を砕き、それを、蒸して柔らかくしたバナナの葉に包んで炭火で軽く焼いた料理です。
this is eos
このレシピは、アジアの数地域で知られています。
this is eos
を意味します。
this is eos
という名前は、この料理の柔らかくトロリとした食感から由来しています。
this is eos
魚を使ったオタオタが、最も一般的ですが、エビやイカ、カニ、魚の頭などを用いたものなど、そのバリエーションは豊富です。
this is eos
this is eop

The correct output should be this:

 「オタ」とも呼ばれているこのペラナカン(華人)の特製料理は、とてもおいしいスナック料理です。
this is eos
これは、ココナッツミルクやチリペースト、レモングラス、ガーリックと一緒に魚を砕き、それを、蒸して柔らかくしたバナナの葉に包んで炭火で軽く焼いた料理です。
this is eos
このレシピは、アジアの数地域で知られています。
this is eos
「オタオタ(otak otak )」は、マレー語で「脳」を意味します。
this is eos
「オタオタ(otak otak )」は、マレー語で「脳」を意味します。この「オタオタ」という名前は、この料理の柔らかくトロリとした食感から由来しています。
this is eos
魚を使ったオタオタが、最も一般的ですが、エビやイカ、カニ、魚の頭などを用いたものなど、そのバリエーションは豊富です。 
this is eos
this is eop
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:49:03+00:00Added an answer on May 20, 2026 at 10:49 am

    Try this:

    u'[^!?。]*[!?。]'
    

    It looks like quotes (「」) do belong in sentences, so you want to allow them.

    I should warn that in general (well, in English grammar), it is very difficult (or even impossible) to parse whole current sentences. (consider 1.2, Dr. Fleishman, etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my current line of code: $(<li>).text($(this).text()).appendTo(#theList); Which results in <ul id=theList> <li>blah</li>
I'm running code that sometimes yields this: UInt32 current; int left, right; ... //sometimes
I have an input that contains a text. When I click into this input,
To make this simple. I have some text that when you click on it.
Hey, well I don't really know how to describe this but here's my current
I'm using Vim to write text that isn't code, just free form writing. To
I have some text that looks like this: [Verse 1] [B]This is a song
I found this macro for Word that replaces text anywhere (headers, footers, body, text
So I've got a text input that get's date & time in this format:
I have a single line of text that looks like this: GIVE US A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.