Help, How to detect the end of sentence in a plain text

Hi, Everyboday
I really don't know how to use ArrayList and endsWith to realize detecting the following question. Could you give me some help? Thank you!
1. find the end of the sentence. that means that we print it out if you meet "!" or "." .....
2. calculating the frequency of the key word in the whole text. maybe using IDF..
import java.io.*;
class SearchEnd{
     public static void main (String[] args){
          try{
               File myFile = new File("Test.txt");
               FileReader fileReader = new FileReader(myFile);
               BufferedReader reader = new BufferedReader(fileReader);
               String line = null;
               while ((line = reader.readLine()) != null){
                    System.out.println(line);
               reader.close();
               }catch (FileNotFoundException exception){
               System.err.println("File not found");
               }catch(IOException exception){
               System.err.println("IO Error");
}

Checkout this thread about how to use these forums effectively. Particularly with College home type questions, expected to be taught how to find the answer rather than be given it outright.
http://forum.java.sun.com/thread.jsp?forum=54&thread=190747
-- Question ---
There are lots of ways to do this, check out the API documentation http://java.sun.com/j2se/1.4.2/docs/api/
Your sample shows you can iterate the string so checkout these three classes.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/StringTokenizer.html

Similar Messages

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to detect the end of an external swf loaded into a container

    Hi,
    I'm having trouble finding a solution for this problem, can somebody help me?
    I have a main swf that will load external swfs into a container. I need to detect the end of the loaded external swf in order to start to load and play a new one into the same container.
    The problem is that i do not know what the length of the external swfs will be, and will have no control over the development of them, so i cannot place a variable at the end of their animation which would allow me to detect from the main movie its end.
    I also cannot rely on the _totalFrames property because the loaded swf might not have all the animation inside its main timeline.
    Is there any way to achieve this goal?
    Thx

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • How to detect the end of a movie clip:  what eventListener to use?

    I'm doing a rather fancy button with up,down,rollover,rollout,and static states, something the standard flash button structure isn't capable of as far as I can tell, and believe me, I've tried it.
    Here's the setup:  My main timeline has a series of frames with stop(): scripts, and each frame has a movie clip representing what should happen during that state:  still, rollover, rollout, mousedown, mouseup
    I can't get the mouseup event  to work.
    Here's what I've tried so far that doesn't work:
    1. in the imbedded movieclip, no script at the end.  Result: This just loops the embedded clip.
    2. in the imbedded movieciip, put gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: loops clip
    3. in the imbedded movieciip, put root.gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: error
    I think what I need to do is write an eventListener for the root actionscript, but I don't know what event to listen for. 
    What event is thrown when a movieclip finishes playing?
    :<)McFrisco

    You have to create your own mechanism(s) for detecting the end of a movieclip being reached.  You can either build code into the end of the clip itself, possibly dispatching an event that is being listened for by a containing timeline, or you could continuously monitor the currentFrame of the clip to see if it equals the totalFrames value.

  • How to determine the end of sentence

    I have some text for example:
    "I love a girl. Her name is Sue. She lives in PA."
    Now I want to write a program to separate it into 3 strings and put them into array, so I use a while loop and "Match Pattern" vi. My plan was to find  "." . However, it doesn't work becuase ".". in Labview mean any character. Does anyone have any clue what I should do?
    thanks
    ====================
    =Labview 7.0 & 8.0 & 8.5=
    =====================
    Attachments:
    Untitled.vi ‏18 KB

    Preceed the point by a  backslash.
    The point is a special  character, see help for the match pattern function -> special characters.
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Detecting the end of an flv in ac 2

    I have a custom player i built. How do i detect the end of
    the flv so i can prompt an action, like go to another frame for
    instance or loop or call another flv. Have been struggling to find
    a solution online and keep hitting dead ends..
    Thanks in advance if someone can help... need this in
    actionscript 2

    unsure...
    I was just using keyframes on a timeline to play different
    flvplayers, brought in through import. I have used netstream
    successfully but i lose the player controls...

  • Is there a way to detect the end of a video?

    Is there a way to detect the end of a video.. .mp4 or youtube? I want to be able to detect the end of a video and then have it do something...ie play on timeline or go to and play symbol.

    For youtube the code would be something like this:
    view-source:calkaweb.herobo.com/video.html
    for HTML5 videos for youtube replace &version=3 with &html5=1 in the youtube URL
    I have no idea how to impletent the youtube code into Edge tho other than an iframe but that wouldn't work I've tried :
    http://forums.adobe.com/thread/1285212
    You would need to place all of the youtube codes into edge in order for it to work but I duno how to do that and no1 answered the question in the thread I made about it.
    as for MP4/HTML5 video you can use
    var video = document.getElementsByTagName('video')[0];
        video.onended = function(e) {
          /*Do Something*/

  • How to get the end time of an Interface?

    How to get the end time of an Interface?

    Hi,
    As per your reuirement. I will suggest to use IKM SQL to SQL append. and Before Insert statement in IKM u need to add one more step i.e update. Your update should be like this
    command on sourse.
    <%for (int i=0; i < odiRef.getDataSetCount(); i++){%>
    <%=odiRef.getDataSet(i, "Operator")%>
    select      <%=odiRef.getPop("DISTINCT_ROWS")%>
         <%=odiRef.getColList(i,"", "[EXPRESSION]\t[ALIAS_SEP] [CX_COL_NAME]", ",\n\t", "", "((INS and !TRG) and REW)")%>
    from     <%=odiRef.getFrom(i)%>
    where     <% if (odiRef.getDataSet(i, "HAS_JRN").equals("1")) { %>
         JRN_FLAG <> 'D'
         <%} else {%>
         (1=1)     
         <% } %>
    <%=odiRef.getJoin(i)%>
    <%=odiRef.getFilter(i)%>
    <%=odiRef.getJrnFilter(i)%>
    <%=odiRef.getGrpBy(i)%>
    <%=odiRef.getHaving(i)%>
    <%}%>
    Command on target..
    UPDATE <%=odiRef.getTable("L", "TARG_NAME", "A")%> T
    set <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD2)")%> ='N',
    <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD1)")%> =SYSDATE
    where (<%=odiRef.getColList("","T.[COL_NAME]", ", ", "", "UK")%>)
    in(<%=snpRef.getColList("", ":[CX_COL_NAME]", ", ", "", "UK")%>) and <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD2)")%> <> 'N'
    check UD1 and UD2 columns.
    Hope this will help you.
    Regards
    Saurabh

  • How to detect the final loop iteration of a step in a PostStep Engine Callback?

    I see the need to use a PostStep Engine Callback and look at the Step.Result container of the caller.
    My issue: If the caller is configured to loop, the PostStep Engine CB executes with each iteration and I do not see how to detect the final iteration (which is the only iteration I am interested in).
    Ideas are welcome. Thanks in advance,
    Guenter

    Guenter,
    well, the way i discripted IS the generic way. The reason for this is the following:
    You can compare TestStand very well with procedural programming languages. So you have variables with different lifetimes and scope. RunState is one variable, which is available in every scope, but it may have different content.
    So you leaving the execution of your clientsequence in order to call the callback, you leave the scope of the RunState from your clientsequence. But only there the information is stored on how many iterations are left. It does not make sense to pass this anywhere, since the execution of your clientsequence has to decide if to loop further or not.
    But, please note that there are different scopes for the "disable result recording" as well. You have found the most global one, the station option. But you can as well set this in the sequence settings (Edit >> Sequence Properties >> Disable Result Recording for All Steps) and at step-level (Run Options >> Record Result {uncheck it}).
    Looping on a single step using the step settings, you can additionally choose not to record results for each iteration. This will lead to only a single entry in the ResultList, the overall result of the looped step (if resultcollection is enabled of course!).
    hope this helps,
    Norbert 
    Message Edited by Norbert B on 08-22-2008 02:10 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Qtn: I have 10 standard elementary search helps in collective standard search help, how to deactivate the 10th elementary search help?

    Qtn: I have 10 standard elementary search helps in collective standard search help, how to deactivate the 10th elementary search help?

    Hello,
    this topic is still a problem for me, does anybody have an idea.
    Just to show what's my problem:
    Collective Search help KRED does include a SAP append-search help ASH_KRED which holds the elementary search helps KREDC, KREDE, KREDM, KREDW.
    The search helps KREDE, KREDM, KREDW should not be displayed, so I added another Serach-Help-Append ZKRED_CUST at the end of CSH KRED which holds these 3 SH's with the hidden flag.
    That works, the SH's are not shown anymore.
    I also added some other of the Original SAP SH's (e.g. KREDA) with the hidden flag and added changed copies of these (e.g ZKREDA) there to be shown instead.
    All this can be done modification free by appends.
    The folders of the elementary search helps are shown in the order as they are found included in the KRED SH and the append to this SH.
    This means that the not hidden Sh KREDC from ASH_KRED is shown before all the "custimized" ZKREDx -SH's. But we need this SH not very often, so that I want it to displayed al the right-most position of the folders of SH's or at the most down postition of the drop-down-selection of SH's.
    But I have not found any way to do this modification free.
    The only way to archive this is to modify ASH_KRED by setting the Hidden-Flag for KREDC and add this SH at the end of append-SH ZKRED_CUST again.
    But I want avoid this modification.
    So, is there any way to do this without modifing any of the original SAP SH's ?
    Helmut Fischer

  • Need GREP expression to Find MD., PhD., FAAC. etc. but not at the end of sentence

    I'm just starting to utiilize GREP a little and was trying to write an expression the would find two or more uppercase or uppercase, lowercase, uppercase combination followed by a period such as MD., Phd., FAAC. etc. I'm attempting to to find those instances and remove the period so that it reads MD, PhD, FAAC etc.
    I came up with (\u\u|\u\l\u+)\. which works OK except that it also finds anything with 2-3 uppercase letters at the end of a sentence as well, which I dont' want.
    I also used $1 in the change to box to capture the phrases which seems to work fine as well.
    I would really just like to not find anything at the end of a sentence.
    Maybe something with lookahead or lookbehind. That's confusing me as well.
    Thanks for any help in advance.

    pixxel schubser:
    Great idea. Here is a sample of the text. I need to eliminate all the periods after the Titles but leave the commas if they are there but I don't want to remove the periods if they happen to appear at the end of sentence. Hope this is clearer. Thank you all for helping out.
    d.
    Author(s):
    Erik Wissner, MD., FACC
    Sebastian Deiss, MD.
    Tilman Maurer, MD.
    Michael Botros, MD.
    Karl-Heinz Kuck, MD., PhD., FACC
    Introduction | Objectives:
    Catheter ablation of atrial fibrillation (AF) using magnetic navigation is feasible with similar long-term success rates, but typically more time-consuming than manual ablation. The 3. generation magnetic navigation system (EPOCH, Stereotaxis Inc., St. Louis, MI) allows for improved catheter response times potentially shortening procedure duration. We compared procedural data using the EPOCH system with previously published data from our laboratory using the 2. generation system for catheter ablation of AF.
    Methods:
    Catheter ablation of atrial fibrillation (AF) using magnetic navigation is feasible with similar long-term success rates, but typically more time-consuming than manual ablation. The 3. generation magnetic navigation system (EPOCH, Stereotaxis Inc., St. Louis, MI) allows for improved catheter response times potentially shortening procedure duration. We compared procedural data using the EPOCH system with previously published data from our laboratory using the 2. generation system for catheter ablation of AF.

  • How to detect  the Collission for duplicated movieclps

    Hey guys .. i am back with set of query..till now .. key
    press movement a rocket (mc) is moving left right up down in a
    defined stage area. and i am able to generate some fire balls
    randomize falling from top. this is just i am duplicating the movie
    clip(fireball_mc) .... now i want incase or when the rocket (mc)
    touch the fire ball programm shold detect the collsion and generate
    a score board. well for this i have tried a script for two movie
    clips ... wchich is working but ..i don know or i m not gettng the
    logic how to detect the collission for duplicated movie clips...
    well i m just giving the script for oinly 2 movie clips
    coliding...can any one tell me how to do it with randmize or
    duplkicated mcs??
    for 2 movie clip ...
    _root.mc1.onEnterFrame = function() {
    if(this.hitTest(_root.egg)) {
    _root.result="Oh no..... we are dead";
    } else {
    _root.result="we are going fine";
    (this is happening ..but let me know how can i get the same
    result for ranndom mcs)
    hope someone can help me out ...
    i appriciate ur valuable time to read this..
    thanking you

    Hey thx for ur suggestion...but as i said m very much new to
    actionscript (more designer) so i don have much idea... most of the
    things i m doing for this game i m going through lots of references
    then i tried to understand te codes m implmenting them to my
    need..can u explain me little more about arrays u haves asked for
    loops u asked me to use the hittest function..please /.. i will be
    greatfull to u... thx

  • How to detect the Acrobat Browser Plug-in version installed on a users system for non-IE browsers?

    How to detect the *Acrobat Browser Plug-in version* installed on a users system, on Firefox, Safari, Opera, etc?
    Or one script for detecting Plug-in version for major browsers. Need full example code.

    Wrote an article on this with code samples (Javascript + HTML) - basically there are differences between IE and other browsers. Chrome natively comes with the Chrome PDF Viewer so I've incorporated that in my detection script.
    The script detects the browser type, and the installed acrobat version...
    Have a look here:
    Detect the Adobe Reader Plugin

  • How to detect the path of Temp directory

    I am writing a class library which allows users to manipulate a database in the web server java applications/applets. In my logic the Application/Applet communicate with a CGI script/Servlet in the server and that do all the database handling. My objective is to make the Client independant from the Database Drivers, and to some restrictions and possible security threats that can arrice when accessing the database directly.
    99% of the work is done and now I am doing the fine tuning.
    My Problem:
    When the user downloading a blob object from the server database. each time the program read the blob it will get a new copy from the server. This is not good if the blob is large (few 100 megs) . So I am going to implement a cache system. but the problem is If I am caching in the memory it will not support large objects (Memory is a limited factor). So the preferance is use the Temperary files but I do not know how to detect the path to temperary folder.
    And my 2nd questions is are the applets allowed to write and read in temperary folder.

    The Java default temporary file path can be determined with
    System.getProperty("java.io.tmpdir")This is typically the same value as the os environment variable

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

Maybe you are looking for

  • HT1420 How to transfer purchased items from iphone to itunes

    How do you transfer purchased items from an iphone to itunes?

  • SPA400 turned off on a firmware upgrade

    Accidentally a SPA400 was disconected while upgrading the firmware and now, all ports leds just keep turned on when connected. It dose not response to the last ip that was asigned, I even reset the device but it dose not get an ip from the DHCP serve

  • Can I use Apple Ram in a Windows Computer

    I recently upgraded my ram from 4 to 8 GB (I took out the 4 GB, then put in the new 8 GB of ram) and now I have 4 GB or ram that is not being used or in my computer. I was wondering if I could use that same ram to put in a Windows PC that I have? The

  • Safari 7.0.4 Flash in-app Ad issues

    Safari 7.0.4 does not block the In-app flash ads... I tried Glimmberblocker, Safari extension, actually downloaded safari adblock from their site. Non of them works. Anyone know how to block the flash in-app ads??? I mean before you start a video the

  • About SAPRFC connector for PHP...

    I open this new post because Gregor make me notice that the thread where I initially post it was close...Sorry about that -:) Ok, question is...How can contact Eduard Koucky??? I wrote him some time ago, but he never answer me...Gregor just told that