create computer program to translate real world descriptions into knowledge representations
PS:pick whichever language you prefer:). And this is regarding artificial intelligence study.
Solution
// TextProcess.java
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class TextProcess {
// method to load all words from a file into an array list
static ArrayList<String> fileToList(File file) {
// creating an array list
ArrayList<String> words = new ArrayList<String>();
// opening file
try {
Scanner scanner = new Scanner(file);
// loops and add each and every word to words list
while (scanner.hasNext()) {
words.add(scanner.next());
}
// closing file
scanner.close();
} catch (FileNotFoundException e) {
// error, the file is not in the same directory
System.out.println("File not found!");
}
return words;
}
// method to extract the words begin with a character ch from an array list
// of words
static ArrayList<String> beginsWith(ArrayList<String> inputList, char ch) {
// creating a list
ArrayList<String> result = new ArrayList<String>();
// looping through each word in input list
for (String word : inputList) {
// checking if word starts with the given character,
// note: this check is case sensitive, if you want to check without
// case sensitivity, convert word to lower case by calling
// word.toLowerCase() and convert ch to lower case by calling
// Character.toLowerCase(ch) just like below commented code
// if(word.toLowerCase().startsWith(""+Character.toLowerCase(ch))
if (word.startsWith("" + ch)) {
result.add(word);
}
}
return result;
}
// method to print all words in a list separated by space
static void print(ArrayList<String> inputList) {
for (String word : inputList) {
System.out.print(word + " ");
}
System.out.println();
}
public static void main(String[] args) {
//
/**
* creating file object. make sure that you have the file cs.txt in the
* root directory of your project. if not, copy the file from the
* folder, go to the IDE (eclipse, netbeans etc) right click on project
* name, click paste, the file will be added. If you fail to do this
* correctly, the file will not be loaded, and this is not mistake in my
* code.
*/
File file = new File("cs.txt");
//loading words
ArrayList<String> words = fileToList(file);
//getting words start with 'a'
ArrayList<String> wordsBeginWithA = beginsWith(words, 'a');
//printing words start with 'a'
print(wordsBeginWithA);
}
}
/*OUTPUT*/
and approach and applications. and algorithms acquisition, and access as a and a and a and as and are abstract, as applications. approaches aspects and and and accessible
Kindly Upvote if Helpful :)
HOPE THIS MAY HELP YOU----------------------
------------------------------THANK YOU---------------------------
create computer program to translate real world descriptions into knowledge representations PS:pick whichever language you prefer:)....
write computer program to translate the following descriptions into knowledge representations a) Water is a liquid between 0 and 100 degrees. b) Water boils at 100 degrees. c) The water in John’s bottle is frozen. d) Perrier is a kind of water. e) John has Perrier in his water bottle. f) All liquids have a freezing point. g) A liter of water weighs more than a liter of alcohol. PS: use whichever language you prefer
create computer program to translate the following statements into First Order Logic. You can use whichever language you prefer. PS: please read the question carefully. It said write a program with whichever language you prefer. a: all cheetahs are fast. Domain: animals; b: some cheetahs are fierce and dangerous. Domain: animals; c: every prime number is odd. Domain: integers; d: all prime numbers except two are odd. Domain: integers; e: all aliens are either green or orange. Domain: living creatures;...
C - language please 1. Create a program that does the following, make sure you can complete this before moving to further questions, when compiling add the -Ipthread argument, if you are using gcc use the -pthread argument. Creates two threads, the first uses a function hello world() which prints hello world, the second uses a function goodbye() which prints goodbye. • Each function has a random sleep duration before printing the output - After running your program a few...
In trying to apply my knowledge in the real world, I am trying to create a realistic retirement schedule. However, I am running into difficulties using both a financial calculator as well as our equations from class in doing this. I am trying to do the following: plan a retirement schedule between the ages of 25 and 70, in which I would deposit 20% of my income each year. The income starts at 80,000 with an annual growth rate of...
Use your rules for translations and reflections to create a picture. You may do this on paper or using a computer program, such as Geogebra. Follow each step, in o 1. Graph a hexagon with vertices at (-4, 0), (-2, 0)·(-1,-1), (-2,-2), (-4,-2), and (-5,-1). 2. In the center of the hexagon, label it A. 3. Reflect hexagon A across the y-axis 4. Label the reflected hexagon A 5. Go bak to hexagon A, and translate it using the rule...
C++ program: can you help create a autocorrect code using the cpp code provided and the words below using pairs, vectors and unordered map: Objectives To practice using C++ std::pair, std::vector, and std::unordered_map To tie together what we've learned into the context of a real-world application used by millions of people every day Instructions For Full Credit You're given a short list of words in known_words_short.txt that contains a handful of very different words. Assume this short list of words...
You will create a PYTHON program for Tic-Tac-Toe game. Tic-Tac-Toe is normally played with two people. One player is X and the other player is O. Players take turns placing their X or O. If a player gets three of his/her marks on the board in a row, column, or diagonal, he/she wins. When the board fills up with neither player winning, the game ends in a draw 1) Player 1 VS Player 2: Two players are playing the game...
You are required to create a robot path planner that is able to find an optimal path to navigate an environment and reach a target. By completing this assessment, you will show your skills on leveraging the best algorithm to solve a simplified real-world problem.The maze can be seen in the image below. It can be seen that there are 12 rows and 24 columns, meaning there is a total of 288 blocks on the map. There are four different...
Explain what enterprise resource planning (ERP) systems. Outline several of their key characteristics. Describe in reasonable detail how a company leverages an ERP system and how its operations are improved after installing an ERP system like SAP. Explain how a supply chain management system helps an organization make its operations more efficient What is Upstream and Downstream management of the supply chain? Explain the concept of “Supply Network”, its benefits, and how technology made this concept available Explain the difference...
making a file You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which...