Page 2 of 2 FirstFirst 12
Results 21 to 21 of 21
  1. #21
    akeni is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default Re: changing telephone numbers into words.

    okay, i have another problem.

    so say for the number


    this can be two words. for ex. you-cool.

    now in say for example my dictionary file has the word you and cool but not youcool.

    How do i set it to so i can get matches for two words?

    this is what i have so far:
    Java Code:
      public static void MatchNum ( Map<String, Set<String>> dict) throws FileNotFoundException{
    	      File myFileTwo = new File("telephone.txt");
    	   Scanner inputTwo = new Scanner(myFileTwo);
    	   while (inputTwo.hasNext()){
    		   String Number =;
    		   Number = Number.substring(3);
    		   String NumberTwo = Number.substring(0,3);
    		   Set<String> matchesOne = dict.get(NumberTwo);
    		   String NumberThree= Number.substring(4,7);
    		   Set<String>matchesTwo= dict.get(NumberThree);
    		   Set<String> matches = dict.get(Number);
    		   System.out.println (" " +matches);
    in this code, i broke down the string Number into two parts 0 to 2 and 3 to 6. Now how can i join those matches together?
    Last edited by akeni; 11-24-2011 at 01:42 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Converting numbers to words
    By Zora in forum New To Java
    Replies: 2
    Last Post: 11-14-2011, 11:10 AM
  2. Writing a java applet that converts numbers to words
    By derekmski in forum Java Applets
    Replies: 1
    Last Post: 04-16-2011, 03:33 AM
  3. using a pc like a telephone
    By totitua in forum New To Java
    Replies: 3
    Last Post: 06-03-2010, 12:16 PM
  4. new to java, converting words into numbers
    By echo33 in forum New To Java
    Replies: 4
    Last Post: 04-22-2009, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts