Java method for checking spelling [duplicate] - spell-checking

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Looking for Java spell checker library
Is there any method for checking spelling of english words.
I have word game where I have to select letters to form a word and then check it for spelling, if correct then show on the panel.
the methods and the use of these methods, please.
thanks.

You need a dictionary of accepted words, and compare against that. If you want to recognize similar words then you'll want to start with prefixes and suffixes and move on to levenstein(?) distances
... Or you can use String.equals()

Related

Scenario Outline And Examples in karate [duplicate]

This question already has an answer here:
In Karate Scenario Outline test, how to pass param values in the Examples table through a variable
(1 answer)
Closed 1 year ago.
I want to run my scenario with all the images that i have in my resource folder. meaning every time hitting same api with different image(converting them to base64encoding first) .But as this images already are in resource folder than it does not make sense to save with some name or records in csv for scenario outline purpose. Can i call a my own function (having code to take the image from resource folder and convert it into base64) in Examples section , So that for every image it will hits the same api again.
Yes. First write some java code to get a list of the image files. You can refer this code for ideas: https://stackoverflow.com/a/65035825/143475
If that is too hard, then just create a CSV file with a list of paths. Let me say that Karate is designed for testing, but you seem to be expecting something else. Karate is not a "general purpose" programming language. But it can be made to do extreme things by Java interop.
One you have a JSON array, then it can be used as the data-source for the Examples: section: https://github.com/intuit/karate#json-array-data-source
You can refer other answers for Base64 conversion: https://stackoverflow.com/a/46452864/143475
All the things you want to do is possible, but please do some research and try. And the next time you ask a question, please show what you tried and give examples instead of just a broad question, thanks.

Complete List of Commands of SELENIUM IDE [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I m new to selenium and in first phase i am trying hard to grasp IDE commands but the main problem that i m facing s that i m unable to search a Single helping material which clearly tell me the following points if any one knows kindly refer me
Complete List of Commands
Commands with reference to scenario(e.g when we use asserttext or
verify text)
what will be the values of Target and value.
http://release.seleniumhq.org/selenium-core/1.0.1/reference.html
This is the complete reference that contains
All the commands supported.
Descriptions to the methods including explanation of the difference between assert and verify.
The target is usually the locator of the element. The value is usually a parameter of the method - for instance, when you're typing into a field, the value would be the text you want to type in. More in the reference of every single command - not all the commands take both target and value, some have their values restricted etc. See your particular command to know what parameters it needs.
Anyway, the most helpful piece of documentation for IDE is still the official docs even though they don't really have a list of all commnads.
1) If you are using the Selenium ide for firefox the full list of commands is visible by clicking the down arrow in the command section.
Failing that there should be plenty of useful information in the selenium documentation
http://docs.seleniumhq.org/docs/index.jsp
2) This one I can't help with very much, as I generally use asserts everywhere. If i want my script to fail at a particular point if text is not present in java I use something like
assertTrue(driver.getPageSource.contains("Text to verify");
3) Target is the element and value is the current value of that element.
Example - Assert that text is present
Command - assertTextPresent
Target - Blank
Value - Text to search for
Example 2 - Field contains certain text
command - assertTextPresent
Target - id=idOfField (id, xpath, css, name etc)
Value - Text to search for
http://software-testing-tutorials-automation.blogspot.in/search/label/selenium%20ide
This website have a lot of IDE examples and tutorials. If you are beginner if so this website is the best I think.
I think this is the most complete and most readable list of the selenium IDE commands:
http://www.frontendtest.org/blog/selenium-ide-commands/

How do they get this snapshot? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Server Generated web screenshots?
Whenever i use
goo.gl to shorten urls
, i see a screenshot of the url's page!
It's not usual screenshot - there're no UI elements - only the page itself!
My question: How do they do it? What is the general logic behind generating this screenshot(raster image)?
#valentinas no. i'm not after implementation. I'd like to get a
general idea how it's done! (and also, without using canvas element) –
DrStrangeLove 6 mins ago
General idea: you take a browser rendering engine (webkit is pretty good, here's one of the implementations: http://phantomjs.org/) and instead of outputting the result to UI you take it and dump it to file.

Formatting Objective C source files [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Objective-C style formatter
I'm very picky about the formatting of my Objective C code. Lately I've been obliged to work with quite a bit of Objective C code that wasn't written by me, and I would like to format it according my own customary code formatting standards (e.g. ANSI bracket style, spacing between method name and first argument, etc, etc.
Of course, I know I can throw together something in Perl to automate this for me, but I was hoping there was a tool out there which could do the job for me. So, is there some free tool available for formatting Objective C files?
For quick but not complete formatting (mainly indenting) select the code and control-I. THis is about the same formatting as obtained by pasting code.
OK, found Uncrustify, which does the trick:
http://uncrustify.sourceforge.net/
And a sample config file for Objective C here:
http://blog.carbonfive.com/2009/08/07/code-formatting-in-xcode/
There's even an XCode plugin available:
https://github.com/benoitsan/BBUncrustifyPlugin-Xcode

iPhone Number Text To A Full Currency Equation [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Struggling with currency in Cocoa
Re-Apply currency formatting to a UITextField on a change event
I have been all over the web and either examples are no longer valid or people didn't really know what they were doing.
So i have come to you guys for help,
I need to get a a textbox(TextField) to Display when they click into it a "$"...that was Easy lol
but i also need from the dollar sign to $0.00 then $0.01, $0.10 and so on.
And save an instance of it without the Symbols.
I am very new to Objective C and would like maybe a simple explanation or even a good blog to read about it. "only if you just recently read it and its not outdated"
You want to use NSNumberFormatter to accomplish this. The NSNumberFormatter documention from Apple is very good (I've just re-read it and it's not outdated). Specifically, look at the section on Configuring the Format of Currency. This should be enough to get you started.
Another good place to look if you prefer examples to documentation, is to read through the section on Number Formatters from Apple's Data Formatting Guide. This goes through examples of how to set up currency formatters to your specifications with concrete examples.
Finally, in order to integrate this with a UITextField, you will want to use the delegate method
– textField:shouldChangeCharactersInRange:replacementString:
This allows you to validate and update characters as the user types them in.