|
Programming language translator? Human language translator?Member 10517704 wrote: i do not know how to start how to implement statistical machine translation algorithm in c# Do you know how to use Google? Why don't you search around there and see what you can find - the research you do will be useful to you.
Finally, remove your email and Skype addresses unless you really, really want to be spammed.
This space for rent
|
|
|
|
|
i think google also use machine translator technique and this is my University task to create on translator
|
|
|
|
|
So what have you done so far? What research have you undertaken?
I have to say that I admire the breadth of your ambition - the teams at Microsoft, Google, etc, have spent years with teams of PhDs and postgraduate researchers slaving away.
This space for rent
|
|
|
|
|
i have just read Statistical Machine Translation article nothing else
|
|
|
|
|
One article or multiple articles on that subject?
This space for rent
|
|
|
|
|
|
Then I'm afraid that you have probably taken on a much bigger project than you can manage. As others have said here, you're better off looking for a project that is more to your skill level. When you do a final project, you show off the skills that you have learnt; it's never meant to be about taking on something you have no idea about.
This space for rent
|
|
|
|
|
This is a project of immense complexity. I highly suggest you pick another project, one that you can finish within the school year.
If you have to start a project by begging for tutorials in a forum and starting your "questions" with the phrase "I have no idea where to start" you've got a huge problem.
|
|
|
|
|
You are indeed a master of understatement!
He's either a damn sight better than I was at his age, or he hasn't realised that it's just a bit complicated to implement natural language translation...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
The mind boggles!
PS: Was wanting to talk with you regarding that little bit of space you have in your sig for rent ...
|
|
|
|
|
Reasonable Rates.
This space for rent
|
|
|
|
|
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
I've removed them from your message.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
So im practicing some C# basic concepts and was writing some code to simply calculate the income of a person after asking them to input their name, PayRate and Income and then displaying the income of that same person before and after taxes. However, after the user inputs their hours-per-week the program seems to jump past asking for their PayRate and displays their weekly income before and after taxes, so if someone could point out what i did wrong itd help me out, Thanks! Also the Console.ReadLine() and the console.Read() at the end of the program is to simply keep the command window open so i can check my work since it seems to want to close immediately after the code has been run instead of allowing me a chance to analyze the output so if someone could help me with that too it would be greatly appreciated thanks again.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LearningCs
{
class Program
{
static double CalcWeeklyIncome(double hours, double PayRate)
{
double income;
income = hours * PayRate;
return income;
}
static double CalcIncomeAfterTaxes(double income)
{
const double TaxRate = .2333;
income = income - (TaxRate * income);
return income;
}
static void Main(string[] args)
{
double hours, PayRate, Income;
string name;
Console.WriteLine("Please Input your Name: ");
name = Console.ReadLine();
Console.WriteLine("Please input your hours-per-week: ");
hours = Console.Read();
Console.WriteLine("Please input your Hourly Pay Rate: ");
PayRate = Console.Read();
Income = CalcWeeklyIncome(hours, PayRate);
Console.WriteLine(name + "'s income before taxes is " + Income);
CalcIncomeAfterTaxes(Income);
Console.WriteLine("The Income After taxes for " + name + " Is " + Income);
Console.ReadLine();
Console.Read();
}
}
}
|
|
|
|
|
Console.Read returns the character code[^] of the next character from the input. For example, if the user types 3, it will return the number 51 , because that is the ASCII code for the number 3.
If the user types 37, then your code will set hours to 51 (the ASCII code for 3), and PayRate to 55 (the ASCII code for 7). When you reach the second call to Console.Read , there is already a character in the buffer, so it doesn't need to wait for the user.
This is obviously not what you want. Instead, you should use Console.ReadLine to read the entire input until the user presses the Enter key.
You can then use Double.TryParse Method[^] to attempt to convert the string to a number:
string input;
Console.WriteLine("Please input your hours-per-week: ");
input = Console.ReadLine();
while (!double.TryParse(input, out hours))
{
Console.WriteLine("Please enter a valid number: ");
input = Console.ReadLine();
}
You'll then need to repeat that for the hourly rate.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i think u should use Console.readline for hours-per-week and pay rate , and then convert it to int it will look like this:
name = Console.ReadLine()
Convert.ToInt32(Console.ReadLine());
|
|
|
|
|
Thanks so much guys I used the Convert.ToDouble method to keep the cents part of the value after taxes, I really appreciate the help, I would never have thought of that to be honest and learned a few new concepts thanks to your responses. Thanks Again!
|
|
|
|
|
Convert.ToDouble will throw an exception if the user enters something that can't be converted to a number. Since you don't handle any exceptions, your program will crash.
Use Double.TryParse instead. That way, your program won't crash if the user enters gibberish instead of a number.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
how to detect the event when you move a folder inside another with FileSystemWatcher in c # halgun exemplification of treating this event
|
|
|
|
|
There are lots of examples online of how to use FileSystemWatcher. Have you gone through any of the examples?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
I'm trying to select all users with a roleId of 4. How can I do that? Here's my JSON string:
{
"?xml" : {
"@version" : "1.0",
"@encoding" : "UTF-8"
},
"DataFeed" : {
"@FeedName" : "AdminData",
"People" : [{
"id" : "63",
"active" : "1",
"firstName" : "Joe",
"lastName" : "Schmoe",
"roleIds" : {
"int" : "4"
}
} , {
"id" : "65",
"active" : "1",
"firstName" : "Steve",
"lastName" : "Jobs",
"roleIds" : {
"int" : ["4", "16", "25", "20", "21", "22", "17", "23", "18"]
}
} , {
"id" : "66",
"active" : "1",
"firstName" : "Bill",
"lastName" : "Gates",
"roleIds" : {
"int" : ["3", "16", "25", "20"]
}
}
]
}
}
Here's the query that I'm using:
JObject jsonFeed = JObject.Parse(jsonText);
from people in jsonFeed.SelectTokens("DataFeed.People").SelectMany(i => i.ObjectsOrSelf())
where (int)people["active"] == 1 && (int)people["roleIds.int"] == 4
select new PeopleClass
{
Id = (int)people["id"],
ResAnFName = (string)people["firstName"],
ResAnLName = (string)people["lastName"]
}
I'm getting the following error on (int)people["roleIds.int"] == 4 :
ArgumentNullException: Value cannot be null.<br />
Parameter name: value
In the end, my results should be: Joe Schmoe & Steve Jobs , only.
What am I doing wrong?
modified 21-Sep-16 12:13pm.
|
|
|
|
|
As you said, the value can be an actual integer or an array, when it's an array it attempts to cast the array as an integer and it returns null value, which causes the error. What needs to happen here, you need to check first if it's an array and then search in the array
var roleFour = (from people in json.SelectTokens("DataFeed.People")
.SelectMany(i => i)
let ids = people["roleIds.int"]
where (int) people["active"] == 1 &&
(ids.Type == JTokenType.Array) ?
((int[]) ids.ToObject(typeof(int[]))).Any(k => k == 4) :
(int) ids == 4
select new {
Id = (int) people["id"],
ResAnFName = (string) people["firstName"],
ResAnLName = (string) people["lastName"]
});
|
|
|
|
|
I'm getting the following error:
NullReferenceException: Object reference not set to an instance of an object.
|
|
|
|