Java program to convert language

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A java program to convert a new language to plain english language. (A exercise for String in advanced programming)

License

BaseMax/ToyLanguageTranslator

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

A java program to convert a new language to plain english language. (A exercise for String in advanced programming)

Question — Roami Language Interpreter

Repeat vowels english character and put ‘ o ‘ between that.

HoHeyoy alollol, hohelollolo hohowow arore yoyou koknonowowloledodgoge! 
Hey all, hello how are you knowledge! 
Method Goal Return Type
toRomani Convert English text to Romani language String
toEnglish Convert Romani text to English language String
isValid Check a Romani text is valid or not Boolean
checkCharType Check one char, it’s English vowels or other symbols int
public static int checkType(char input); public static Boolean isValid(String input); public static String toEnglish(String input) throws Exception; public static String toRomani(String input); 

Question — Zari Language Interpreter

Читайте также:  Javascript onclick and this

strength alpha strong frzzl 
engthstray alphaway ongstray frzzlay 
Method Goal Return Type
toZari Convert English text to Zari language String
indexOfChar Find the position of the first English vowel letter int
minimum Find the smallest value of a array int
checkCharType Check one char, it’s English vowels or other symbols int
public static String toZari(String input); public static int indexOfChar(String input); public static int minimum(int []array); public static int checkCharType(char input); 

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers.

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

About

A java program to convert a new language to plain english language. (A exercise for String in advanced programming)

Источник

How to Translate a Language in Java

Join the DZone community and get the full member experience.

Since the internet stepped into the spotlight in the late twentieth century, it has been doing its part to facilitate globalization on a massive scale. With companies increasing international transactions and individuals from across the world connecting online, we are all growing closer each day.

While these personal and business connections are teaching us a lot about our various cultures, we still encounter language barriers. These barriers can cause considerable inconvenience and frustration for users and businesses alike, which is why the developments that have been made in language translation technology are so valuable.

This brings us to the translation solution that we will be discussing today; if you need to automate language translation between English and either French, German, or Russian, we have a few APIs to help with that. Leveraging Deep Learning AI, we offer the following natural language processing functions:

  • English to French.
  • French to English.
  • English to German.
  • German to English.
  • English to Russian.
  • Russian to English.
Читайте также:  График работы сотрудников php

In this article, I will guide you through how to use these APIs in Java. Each API will begin with the same few steps but will alter when it comes to creating an instance of the API.

Now to start things off, we will first need to install the SDK with Maven by adding a reference to the repository in pom.xml:

Источник

How to translate from one language to another using java

I want to write a core java program that converts the data from one langualge to another language.for example
English to French,french to German, etc..
for this i have tried with Google Translator API for Java, but this is commertial, i am not able to run my program with out HttpReferrer and Key.
And i downloaded the webtranslator api, but i dont know how to use. So kindly provide the example to use this api.

or else, kindly provide, if you have any other possible solution.

Does the package you indicate have API documentation/javadocs? Can you provide a URL to the package download?

i think you are asking about Google Translator API.

GoogleAPI.setHttpReferrer(/*your http referrere*/); GoogleAPI.setKey(/*key*/); String text = Translate.DEFAULT.execute("HELLO", Language.ENGLISH, Language.GERMAN); System.out.println(text); 

i downloaded the jar from

You stated you did not want to use the Google API. The way your post was phrased indicated that «And i downloaded the webtranslator api» — which to me said that you downloaded a non-Google API. I did a quick search for ‘webtranslator api java’, and there appear to be quite a few out there. e.g.:

I started with Experts Exchange in 2004 and it’s been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst

Thanks for your response smeghammer.

Yes i tried the below one.

but i don’t know how to use this, Kindly provide any sample program to use this api.

Читайте также:  Среднее значение двух чисел python

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.

GET A PERSONALIZED SOLUTION

Here is a better GUI based example. I borrowed the tutorial from here as the basis for the GUI.

The download includes a complete source development package (‘WebTranslator-all-0.2a.z ip’). This can be unzipped and imported as a new project into Eclipse.

I have a single class file and a reference to the main WebTranslator-bin-0.2a.jar file. I made a very basic textarea, language dropdown, button and associated listener. The listener just takes the value in the textarea and submits it with the appropriate to/from languages. The translated result is then placed in the textarea:

package guiTest; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JComboBox; import javax.swing.JButton; import javax.swing.JLabel; import java.awt.BorderLayout; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.util.Locale; import java.util.ResourceBundle; //this is the key import for the translation package: import com.javanetworkframework.rb.util.AbstractWebTranslator; public class app   public static void main(String[] args)   new app(); > public app()   JFrame guiFrame = new JFrame(); //make sure the program exits when the frame closes guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); guiFrame.setTitle("Example GUI"); guiFrame.setSize(300,250); //This will center the JFrame in the middle of the screen guiFrame.setLocationRelativeTo(null); //Options for the JComboBox String[] toLanguage = ; //The first JPanel contains a JLabel and JCombobox final JPanel comboPanel = new JPanel(); final JLabel comboLbl = new JLabel("Select 'to' language:"); final JComboBox toLanguages = new JComboBox(toLanguage); comboPanel.add(comboLbl); comboPanel.add(toLanguages); final javax.swing.JTextArea textArea = new javax.swing.JTextArea(); JButton transLateBtn = new JButton( "Translate!"); //The ActionListener class is used to handle the //event that happens when the user clicks the button. //As there is not a lot that needs to happen we can //define an anonymous inner class to make the code simpler. transLateBtn.addActionListener(new ActionListener()   @Override public void actionPerformed(ActionEvent event)   //submit the text in the textarea to an instance of the translator: Locale srcLoc = new Locale("en"); //hardcoded in this example Locale dstLoc = new Locale(toLanguages.getSelectedItem().toString()); //eg fr, de, es AbstractWebTranslator res = (AbstractWebTranslator) ResourceBundle.getBundle( "com.javanetworkframework.rb.com.freetranslation.FreeTranslationTranslatorRB", dstLoc); String output = ""; String textToTranslate = textArea.getText(); output = res.getString(textToTranslate, srcLoc); textArea.setText(output); > >); //The JFrame uses the BorderLayout layout manager. guiFrame.add(comboPanel, BorderLayout.NORTH); guiFrame.add(textArea,BorderLayout.CENTER); guiFrame.add(transLateBtn,BorderLayout.SOUTH); //make sure the JFrame is visible guiFrame.setVisible(true); > > 

Источник

Оцените статью