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

  • SEARCH
  • Home
  • 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 8653073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:27:21+00:00 2026-06-12T14:27:21+00:00

I process some text files that represented in the code below : the code

  • 0

I process some text files that represented in the code below :

the code :

$file = file($files);
$lines = str_replace("'", '', $file);
$noMultipleSpace = removeMultipleSpaces($lines);
$fileContents = array();
foreach($noMultipleSpace as $line) {
    if (isLatin($line) && count(preg_split('/\s+/', $line)) > 25) {
        $newContent = preg_split('/\\.\\s*/', $line);
        foreach($newContent as $newsContent) {
            $pos1 = stripos($newsContent, ':');
            if ($pos1 == false && count(preg_split('/\s+/', $newsContent) > 3) && isLatin($newsContent)) {
                $fileContents[] = $newsContent;
            }
        }
        $content = implode('.', $fileContents);
    }
}​

with the function :

function isLatin($string) {
 return preg_match('/^\\s*[a-z,A-Z]/', $string) > 0;
}

function removeMultipleSpaces($string){
 return preg_replace('/\s+/', ' ',$string);
}

but, in the implode process, the dot paste in the next sentence. for example sentence1 .Sentence2. My expectation is sentence1. Sentence2. what’s wrong? thank you 🙂

the input is text files, for example :

ChengXiang Zhai
Department of Computer Science University of Illinois at Urbana Champaign

ABSTRACT
Temporal Text Mining (TTM) is concerned with discovering temporal patterns in text 
information collected over time. Since most text information bears some time stamps, TTM has many applications in multiple domains, such as summarizing events in news articles and
revealing research trends in scientific literature. In this paper, we study a particular TTM 
task ­ discovering and summarizing the evolutionary patterns of themes in a text stream. We
define this new text mining problem and present general probabilistic methods for solving
this problem through (1) discovering latent themes from text; (2) constructing an evolution
graph of themes; and (3) analyzing life cycles of themes. Evaluation of the proposed methods
on two different domains (i.e., news articles and literature) shows that the proposed 
methods can discover interesting evolutionary theme patterns effectively. Categories and 
Subject Descriptors: H.3.3 [Information Search and Retrieval]: Clustering General Terms: 
Algorithms Keywords: Temporal text mining, evolutionary theme patterns, theme threads, 
clustering

1.

INTRODUCTION

I wanna get the important sentence only, from Temporal Text Mining (TTM)... until effectively

  • 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-06-12T14:27:22+00:00Added an answer on June 12, 2026 at 2:27 pm

    Your intermediate sentences appear to have a trailing space, causing the imploded delimiter to appear off.

    Try this:

    $file = file($files);
    $lines = str_replace("'", '', $file);
    $noMultipleSpace = removeMultipleSpaces($lines);
    $fileContents = array();
    foreach($noMultipleSpace as $line) {
        if (isLatin($line) && count(preg_split('/\s+/', $line)) > 25) {
            $newContent = preg_split('/\\.\\s*/', $line);
            foreach($newContent as $newsContent) {
                $pos1 = stripos($newsContent, ':');
                if ($pos1 == false && count(preg_split('/\s+/', $newsContent) > 3) && isLatin($newsContent)) {
                    $fileContents[] = $newsContent;
                }
            }
            $fileContents = array_map('trim', $fileContents);
            $content = implode('.', $fileContents);
        }
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the situation : Some process writes lines into a fifo file (created
I am trying to process some files that are named xls and can be
I've been asked to process some files serialized as binary (not text/JSON unfortunately) Thrift
I have a directory with several thousand text files that I need to process.
I'm in the process of converting some LaTeX documentation to restructured text and having
I am trying to process some XML to reform it so that this input,
I am using TIdHttpServer to process some commands the problem is that some commands
I wish to make a nested for loop in order to process some files.
I'm trying to make a console app that would monitor some process and restart
I'm using VB.NET for a web-application that starts some process using CreateObject, like this:

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.