2

I am converting Traditional Chinese to Simplified Chinese using a tool developed by mediawiki. It's written in php. I have to use php to call the function in it.

The function call is like :

echo MediaWikiZhConverter::convert("打印机", "zh-tw");

I want to invoke the convert func in my C# program.

How can I do it? Is Phalanger a suitable way?

3
  • 2
    It would probably be easier to reimplement it in C#... Commented Oct 16, 2012 at 9:55
  • If you compile php script using phalanger, you'll get usual .NET library that you can simply reference to your C# project but I agree with @ThomasLevesque Commented Oct 16, 2012 at 9:56
  • Short answer. You can't. You can however pass the arguments as GET parameters to a web script that in turn calls the function Commented Oct 16, 2012 at 12:57

1 Answer 1

1

just make a webrequest to your webserver running this extension. pass the two arguments in the webrequest, get them through the function, and return the result in a webresponse :)

Sign up to request clarification or add additional context in comments.

5 Comments

Eek, so you first translate every word by issuing the webrequest to another server each time? Why not fixing it in the C# application.
well, if this is a fullblown tool to translate words, translating that into c# is one hell of a job i think :/
No I mean translating from withing the c# tool with a library instead of using a online webservice.
@PoweRoy indeed, if the tool/library already exists i would go for that, if you NEED to use the online tool, you could always batchconvert alot of sentences at once :)
Thank you for your ideas and suggestions! I will try to set a php webservice and make a webrequest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.