Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Creating a spellchecker class in C++ Please help with exact requirements Part I

ID: 3803190 • Letter: C

Question

Creating a spellchecker class in C++ Please help with exact requirements

Part I In this part of the assignment, you are to create a class, SpellChecker. You will define some class data members, member methods and helper functions. The class methods will be used to check and correct the spelling of words. Elements of this assignment are intentionally vague; at this point in the semester, you should be able to make your own decisions about appropriate data structures for storing and looking up data, as well as defining helper functions. You can assume that your code will never be storing more than 10,000 valid or misspelled words. Spell Checker should have at least the following Public members: string language: the name of the language this spell checker is using (i.e. "English", "Spanish", Spell Checker should have at least the following Private members: char begin mark: used for marking the beginning of an unknown word in a string char end mark: used for marking the end of an unknown word. SpellChecker should have three constructors (set the object's data members to some default valu Default Constructor, the one with no parameters. Second constructor that takes a string parameter for the object's language Third constructor that takes a string for the object's language and two filenames as parameters. The first filename specifies the file with correctly spelled words and the second filename specifies the misspelled words with their corrections. You will be dealing with two different file types: The data in the first filename supplies a list of correctly spelled words, one word per l aardvark apple acquire

Explanation / Answer

import java.util.ArrayList;
import java.util.List;

public category Cluster purpose centroid;
   public int id;
  
   //Creates a brand new Cluster
   public Cluster(int id)

   public List getPoints() come points;
   }
  
   public void addPoint(Point point)

   public void setPoints(List points)

   public purpose getCentroid() come centroid;
   }

   public void setCentroid(Point centroid) center of mass;
   }

   public int getId()
  
   public void clear()
  
   public void plotCluster()
       System.out.println("]");
   }

}
Point.java


package com.dataonfocus.clustering;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public category purpose personal double x = 0;
non-public double y = 0;
non-public int cluster_number = 0;

public Point(double x, double y)
  
  
public void setX(double x)
  
public double getX() come back this.x;
}
  
public void setY(double y)
  
public double getY() come back this.y;
}
  
public void setCluster(int n)
  
public int getCluster() come back this.cluster_number;
}
  
//Calculates the space between 2 points.
protected static double distance(Point p, purpose centroid) come back science.sqrt(Math.pow((centroid.getY() - p.getY()), 2) + Math.pow((centroid.getX() - p.getX()), 2));
}
  
//Creates random purpose
protected static purpose createRandomPoint(int min, int max) come back new Point(x,y);
}
  
protected static List createRandomPoints(int min, int max, int number)
   come points;
}
  
public String toString() come "("+x+","+y+")";
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.dataonfocus.clustering;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public category purpose {

non-public double x = 0;
non-public double y = 0;
non-public int cluster_number = 0;

public Point(double x, double y)
  
  
public void setX(double x)
  
public double getX() come back this.x;
}
  
public void setY(double y)
  
public double getY() come back this.y;
}
  
public void setCluster(int n)
  
public int getCluster() come back this.cluster_number;
}
  
//Calculates the space between 2 points.
protected static double distance(Point p, purpose centroid) come back science.sqrt(Math.pow((centroid.getY() - p.getY()), 2) + Math.pow((centroid.getX() - p.getX()), 2));
}
  
//Creates random purpose
protected static purpose createRandomPoint(int min, int max) come back new Point(x,y);
}
  
protected static List createRandomPoints(int min, int max, int number)
   come points;
}
  
public String toString() come "("+x+","+y+")";
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote