I'm using celerity to do some screen scraping and have come across the need to identify text elements that are in bold. Celerity offers a strong method but does not offer a bold method. Has anyone figured out a clever way around this with Celerity or other tool. I tried using:
browser.html.gsub!(<b>,<strong>)
browser.html.gsub!(</b>,</strong>)
I though I could replace the bold elements with strong elements and then simply use celerity's strong method, but this didn't seem to work.
Thanks in advance for your help.
It seems strange that b is missing but you can try:
browser.elements_by_xpath('//b').each do |b|
puts "#{b} is a bold tag"
end
Related
I have a grenade BP which the hero throws and wondering how you would set this up ..
I have tried and works fine but this way is caused by a sphere collision and checks what is inside the collision during detonation.
I tried without casting but this didn't work out very well for me, Is there something else I should be doing?
Please ignore the "get overlapping actors" class filter, I only done that as a test, i usually leave it blank.
ideally id like to try some sort on line trace when the bomb detonates so it can check if its a direct hit rather than triggering even when safe behind cover.
Any help is greatly appreciated, thank you!
Is there casting necessary? say I had 10 other different AI characters, id have to cast through them all right
I tried without casting but this didn't work out very well for me, Is there something else I should be doing?
Please ignore the "get overlapping actors"class filter, I only done that as a test, i usually leave it blank
I found out using a MultiSphereTraceByChannel works much better.
So I was wondering if there was anyway to delete text that has the same word over and over like MEE6 or YAGPDB.xyz I tried looking on google but couldn't find anything on google, if anyone knows how to do it I would really appreciate it if you could help me out
If you're looking to spot if a string contains only one word (repeated) here's a pretty simple way to achieve that
if len(set(text.split())) == 1:
# Text that only contains one type of word
I am trying to make a comparison between two different dates in the GDS and present that information in a scorecard.
I have done this in the past with no problem, but this time I want to do an absolute comparison. Although I checked the box to make it an absolute comparison, the information appears with a % sign after it. I would like to see a "p.p." after it or nothing at all.
How can I achieve this result?
You can find below an image of what is happening.
Thanks in advance!
UPDATE:
I solved the issue by aligning all the elements of that scorecard to the right and adding a text box in front of the % sign. It is not perfect, but it works.
Not the answer you're looking for, but I don't think this is currently possible. I had to add a disclaimer below the scorecards to indicate the comparison values are absolute (despite the percentages). Not ideal, but at least it shows the info
I am using Hunspell to stem words for a SOLR instance. For the most part, it seems to be working well.
I'm using the OpenOffice dic/aff files.
However, there are some notable word exceptions, and I'd like to be able to remove these as candidates for stemming.
A great example is "skier", which stems to "sky" because of the following:
in the .dic file
sky/MDRSGZ
relevant rule in the .aff file
SFX R y ier [^aeiou]y
Is there any way to indicate that skier and only skier should be left alone?
Yeah this is a very common thing, just remove the "R"
sky/MDSGZ
But you may then want to add back in on another line "skier" and any other versions of it.
skier/MS
I have had to make numerous changes to this file, and now really wish there was a better option.
For example
Butter -> Butt
Corner -> Corn
Easter -> East
And then another one that is really confusing,
Wind == Wound
On my site before we fixed it if you searched for wind like in "wind power" you ended up with a bunch of bruises and bloody wounds.
Because "wound" like in "I wound the clock" stemmed to wind.
We also decided to remove all RE prefixes. because things like
remarkable -> mark
remove -> move
reset -> set
restore -> store
So if you know of a better dictionary that is better for this please let me know. (I think the main problem is this dictionary is more intended for spell check then for stemming)
I would be willing to start and/or contribute to a git project for a real stemming dictionary to replace this spelling dictionary for everyone out there using this.
have you tried freeling? It is open sourced.
A demo page is here:
http://nlp.lsi.upc.edu/freeling/demo/demo.php
When I pick english, pos tagging I get the following result:
you wound the clock?
you wind the clock?
PRP VBD DT NN ?
also skier, wind power all get the noun stems. It is a great stemmer and analyzer.
not sure about licensing. the download page:
http://devel.cpl.upc.edu/freeling/downloads?order=time&desc=1
I'm trying to find an algorithm for the game master mind with 4 numbers, where each number can be between 0 to 5, giving 1296 possibilities. With the first guess being 1,1,0,0
there are less options left.
I would like to know how to remove the options which are not suitable according to the first guess.
How to use an array(solutions) and array(current solutions)? Should I use parameterization for that?
Is there an algorithm in C to do that?
Thanks a lot for the help!
The simplest to implement is to simply loop trough all your elements and make the once that no longer work false. This might be the best idea here as looping trough 1300 elements is still quite fast however be aware that there is a faster solution in just finding which type of solutions are no longer available.
For mastermind there are multiple algorithms, see wikipedia, however for your first implementation I think they are too difficult.
You could start by using either
Thijser's idea (slightly better than brute-forcing all possibilities),
or try to emulate a human player: using that a white key-peg means correct color in wrong position and a black key-peg meaning correct color in correct position. You can write an easy recursion to take that info into account:
white-peg -> move the colors around ;
black-peg remove colors to find out which of the colors was the one that was correct-in-correct-pos.