#matching strings
Explore tagged Tumblr posts
pythonprogrammingsnippets · 2 years ago
Text
python matching with ngrams
# https://pythonprogrammingsnippets.com def get_ngrams(text, n): # split text into n-grams. ngrams = [] for i in range(len(text)-n+1): ngrams.append(text[i:i+n]) return ngrams def compare_strings_ngram_pct(string1, string2, n): # compare two strings based on the percentage of matching n-grams # Split strings into n-grams string1_ngrams = get_ngrams(string1, n) string2_ngrams = get_ngrams(string2, n) # Find the number of matching n-grams matching_ngrams = set(string1_ngrams) & set(string2_ngrams) # Calculate the percentage match percentage_match = (len(matching_ngrams) / len(string1_ngrams)) * 100 return percentage_match def compare_strings_ngram_max_size(string1, string2): # compare two strings based on the maximum matching n-gram size # Split strings into n-grams of varying lengths n = min(len(string1), len(string2)) for i in range(n, 0, -1): string1_ngrams = set(get_ngrams(string1, i)) string2_ngrams = set(get_ngrams(string2, i)) # Find the number of matching n-grams matching_ngrams = string1_ngrams & string2_ngrams if len(matching_ngrams) > 0: # Return the maximum matching n-gram size and break out of the loop return i # If no matching n-grams are found, return 0 return 0 string1 = "hello world" string2 = "hello there" n = 2 # n-gram size # find how much of string 2 matches string 1 based on n-grams percentage_match = compare_strings_ngram_pct(string1, string2, n) print(f"The percentage match is: {percentage_match}%") # find maximum ngram size of matching ngrams max_match_size = compare_strings_ngram_max_size(string1, string2) print(f"The maximum matching n-gram size is: {max_match_size}")
4 notes · View notes
kizzer55555 · 7 months ago
Text
Super Dead Soulmates
In this universe, any injury or scar you sustain appears on your soulmate. However, for as long as he could remember, Danny never gained an injury that wasn’t his own. When he was very young, his parents would always say that he was just a late bloomer and perhaps his soulmate was a few years younger than he was and thus, just wasn’t born yet. As Danny grew older, they got more absorbed in their work and just seemed to forget about the whole ordeal. Danny never asked them about it again, afraid they might think a ghost had ‘cursed’ him or something. It was hard enough to hide the lack of additional scars at school. Luckily, most people don’t get injured very often so it was easy enough to play off some of his injuries as that from a soulmate. The only ones who knew the truth were his sister and his best friends. Danny was just convinced that he didn’t have a soulmate and had accepted that fact, even if it hurt. Then the accident happened and for once, he was thankful his soulmate wouldn’t have to feel his pain. And even more so when he started to fight the other ghosts daily. Danny was content to live like this, but with more ghost fights, his injuries started piling up. Danny excused them saying that they were from his soulmate. It didn’t completely get rid of the scrutiny but most people bought it. Afterall, how else would puny Fenton get those kinds of bruises? So for a while, that excuse worked…until someone realized that Danny and Phantom’s injuries linked up (I vote Wes). Now normally, the natural conclusion would be that Danny and Phantom were the same person. But due to the fact that one of them was dead and the other clearly alive, everyone gained a new theory…that Phantom was Danny’s soulmate. It would explain the recent injuries as Phantom was often seen fighting other ghosts. And to be honest, this was the perfect cover. It’s not like Danny had an actual soulmate who might show up and this added another layer of protection against people thinking he and Phantom were the same person. So Danny remained silent and let the rumors grow. Sure people now thought he and Phantom were dating but that was fiiiiiinnnneee. (But BOY was that an awkward conversation with his parents). 
And then Kon was born.
As a clone, all he knew from the outside was implanted into his mind. He knew the color of the sky, the sound of music, academic equations and a lot of common knowledge such as soulmates. He knew that injuries were shared between a bonded pair and that everyone had a soulmate. But he was different. He wasn't born a baby and grew up alongside another person. He wasn’t even real according to some people. Yet one day, he noticed bruises lining his arms, he was confused. He should have had impenetrable skin like Superman. As far as he could remember, his skin had never been pierced before. And it’s not like he fought a godlike being that day. He shouldn’t have any injuries. Kon decided to ignore them but the injuries kept showing up. It got so bad that his team started to notice and sat him down asking if everything was alright with his powers or if he was exposed to kryptonite somehow. So, very confused, Kon had explained that the injuries just kept showing up. It was only after his team gave him a curious look and explained the concepts of soulmates did everything click with him. Sure, Kon knew about soulmates but surely that couldn't be what this was! He was a clone! He shouldn’t have a soulmate. It was impossible! But after a few more days of observation and a bit of testing, everyone determined that this was, in fact, a soulmate bond. 
To say Kon was ecstatic was an understatement. Actually, it was a mix of excitement, nervousness, worry, and joy all rolled into one. He was elated at the idea that he had someone meant for him. Someone who would accept all of him. Kon had looked at the others and there had always been a slight jealousy when he saw a paper cut bloom on their fingers or see them rub a bruised knee fondly. 
But more than anything. He was happy because this was proof that he was real. Afterall, a soulmate wouldn’t match with him unless his soul was equal to theirs. His body almost melted with relief at that realization. A weight off his shoulders he never fully grasped was still there. 
Of course there was the worry of why exactly his soulmate had so many injuries. For a hero, it was obvious they would get injured (although they tried to have as much protective padding as possible to limit that possibility. But some injuries still got through.) Yet the amount of injuries Kon’s soulmate sustained were far more than that (because Danny lacked proper padding  and didn’t think he had to worry about a soulmate. Most injuries looked worse than they were anyways due to his fast healing). And on the contrary, Kon’s skin was perfectly clear. With his kryptonian biology, even if he got hurt, it never left a mark. So all the injuries and bruises sustained on him were purely from his soulmate. And there was enough for two people. On the bright side, it helped with his cover, on the downside, Kon started to worry about his soulmate. (Meanwhile, Danny didn’t notice a difference. Sure, sometimes he would feel a temporary ache or sharp pain but no mark was left so he just assumed the pain was sore muscles from a previous battle or that one of his rogues were hitting harder than he thought.) 
As for Kon, he and his team used every resource at their disposal to try and track down Kon’s soulmate. They did this for every member of the team as hero soulmates were in more danger than most but they paid special attention to Kon’s soulmate due to the rapid accumulation of injuries. 
Kon would fantasize on what his soulmate would be like. Would they be tall? Short? They would probably be able to fight. Boy or girl? It doesn't really matter. Kon knew opposite gender soulmates were more common but he wouldn’t mind a guy either. His days were filled with dreams of a mystery person. Someone he could hold in his arms and protect. Who would comfort him after patrols and who he could introduce to his friends. 
After a while, Tim finally found a lead. Some doctor records of a boy in a small town called Amity. Apparently he was prescribed pain medicine to help with ‘soulmate injuries’. The lost of injuries were extensive and after looking at some pictures, they realized that his scars and Kon’s scars lined up. A perfect match. So it wasn’t long before they made a quick road trip to Amity. 
This place was already on the Justice League radar. It was a town that appears to have a permanent portal to the afterlife and was attacked often. (Which might explain why Kon’s soulmate was so injured). The Justice League had not interfered yet because the town had a local hero as well. Someone who seemed good at his job and who Tim was even thinking of recruiting. So this was a good opportunity to hit two birds with one stone. Afterall, not much was known about this mysterious Phantom other than he dedicated his afterlife to protecting this one town. Once they got to Amity they would probably need to check in with Phantom before anything. And despite his impatience with finding the person who might be his soulmate, even Kon was excited to meet this hero. Apparently Phantom had vast experience but also a major power set. He might gain another flying buddy or someone he could wrestle with without worrying about his strength. Afterall, Phantom also supposedly had super strength and even if he didn’t, it’s not like you can kill a ghost. Yet no matter how hard they looked, they couldn’t find him. It was only by coincidence that they stumbled upon Danny instead and his group of friends. 
The first time Kon saw Danny, it was like coming home. He wanted to do nothing more than rush to his soulmate and hug him and vow to always keep him safe. He wanted to prove that he would be the best soulmate ever and he wanted to know everything there was to know about him. He was practically vibrating where he stood in his civilian disguise and it was only his friends that held him back from flying over and surprising the poor boy.
But before he could do anything, a ghost attacked. Kon barely had enough time to grab his friends and dodge when some kind of glowing creature crashed into a building. And while normally he would immediately find somewhere to change, Kon’s first instinct was to check on his soulmate, only to see the two people he assumed to be the boy’s friends but no sign of Danny. Frantically looking around, he didn’t notice the glowing creature behind him (was that a dragon?) but before it could reach him, another glowing figure intercepted the attack. They looked almost ethereal with white hair softly floating in the air and a suit that hugged his muscled form tightly. The figure turned around and gave a sheepish smile towards Kon. “You ok?”
And it felt like for the second time that day, Kon was rendered breathless. 
Someone was protecting him.
Someone was protecting him?
Yet it felt…nice. Warm.
Before Kon could gather his thoughts though the battle picked up in earnest. He and his team found cover and changed into their suits. When they came to help, the person Kon assumed to be Phantom looked surprised at their sudden appearance but it wasn’t long before he and everyone else started working together. Unfortunately, actually fighting the ghost seemed to be impossible. Whenever they got close, their hits just passed right through so Phantom quickly regulated them on defense and citizen protection duty. Occasionally getting a hit in when the creature was tangible. Watching Phantom fight was something. Kon could understand why he was elected to join their team. He had this sort of grace and power that couldn’t be explained in words but was clearly from the experience of many battles.
Despite not being able to do much, fighting with Phantom was fun. They seemed to be completely in sync and it wasn’t long before Kon started to enjoy his loud commentary and puns as the two ghosts fought.
However, one particularly hard hit made it so that the dragon’s claws grazed his chest. Leaving three shallow gashes, but Phantom took the close proximity that attack gave him and sucked the creature into…a soup thermos?
But Kon wasn’t focused on that. He was wholly focused on the stinging pain suddenly coming from his chest, underneath his untouched uniform that clearly had not been hit. Kon didn’t know how to process what was happening. Everything suddenly became louder and he vaguely tried to move but it was like his mind became mush as he tried to process what that meant. He managed to get away for a bit and undid his shit, looking down to see three shallow scratches along his chest. Scratches that perfectly mirrored Phantom. In the corner of his eye, Kon saw a head of black hair and witnessed as Danny reunited with his two friends he had been separated from in the chaos. And as Danny twisted to hug them, his shirt flipped up enough to see another identical 3 scratches along the boy's stomach. Perfectly mirroring Phantoms. 
It was only later that Kon and his team did some more research on the town and it’s ghosts and learned the unofficial secret that Phantom and Danny were dating. That Phantom had Likely come back from the afterlife to protect the town his soulmate lived in. On the bright side, at least now he could confirm Danny really was his soulmate. And he knew where all those injuries were coming from.
Kon had found his soulmate.
Correction, he found his soumates
And they were already bonded to each other.
….so where did that leave him?
There are now two options. 
1: Kon decided that he just needs to woo both his soulmates and starts doing so both as Superboy and as Conner. Danny is very confused who these people are (because as far as he knows, he doesn’t have a soulmate, and since Kon doesn’t visibly show injury, there is no sign (unless Danny somehow injures himself in a place that is visible but he’s been trying to avoid that to make everyone worry less.)). Kon goes all out. He gets flowers, chocolates, writes poetry (whether good or not doesn’t matter) starts wooing Phantom in hero form, showing off his strength and skill whenever possible. (And unfortunately, also his dork side when he isn’t paying attention while flying) Asking to hang out, insist on paying for everything. Danny sees this tall Hunk who is paying attention to him and he doesn’t know what to do. And there are TWO OF THEM! (Also, in this version it might be funny if people suspect Danny and Phantom are dating but don’t know for sure and since they are never around each other, people might assume they just don’t know. So Sam, Tucker, and Jazz are all for Danny possibly starting a relationship with Kon along with Kon’s team who are cheering them on and trying to help the poor clone boy who has no experience with romance. Meanwhile literally everyone else in the town who likes Phantom is trying to run interference and get Danny and their hero together. 
2: The angst option. Kon decides that the fact that he has two soulmates who are together is likely a result of him being a clone. It’s not that he had someone waiting for him (how could he think someone was waiting their whole life just for him? How stupid was he?!) Kon had just hijacked a different bond. So he tries to stay away. Unfortunately, Tim had talked with Phantom while Kon was out of it so now they have started to team up. This makes avoiding him very difficult as he keeps running into Phantom. Moreover, he runs into Danny because they need him for the ghost hunting equipment. And slowly but surely, Kon falls in love with ‘both’ his soulmates but doesn’t want to get ‘between’ them. And Danny wants to know why one of his new teammates is avoiding him.
#Dpxdc#dcxdp#Kizzer55555 ideas#Super dead soulmates au#Danny x Kon#Danny x Conner#Kon is having an identity crisis and Danny helps but then makes it worse.#At one point Danny might figure out clones and decide to have ‘Phantom’ and ‘Danny’ in the same place. Kon sees this and almost combusts.#Kon’s team are the ultimate wingman’s/wingwoman.#Tim is deep diving into research and planning dates. He has a board covered with red string on how to make this work.#It’s scaring some people.#I don’t know if this is young Justice or teen titans so I was vague while writing it. Choose whichever team you like best!#All I know is that this is the version of Kon with all of Superman’s powers. I want him and Danny to have flying races.#Danny is oblivious.#Kon is in permanent gay panic mode.#Kon gets super protective of both Danny and Phantom.#At some point Phantom comes into contact with blood blossoms so that’s going to be fun. :)#The reason They talk to Danny is because he’s Phantom’s ‘supplier’ for Ghost hunting equipment.#Secret third option: they find Phantom first and bring him to the team and Kon thinks he’s his soulmate after seeing matching injuries and#gets closer to him as a friend but doesn’t know how to breach the subject. Then they go to a ‘supplier’ for Ghost equipment that Phantom#Trusts and meet Danny. And then something happens where they see how ‘Danny’ and ‘Phantom’ are ‘soulmates’.#Then you can deviate to the angst version or wooing version.
696 notes · View notes
a-spacecadet · 6 months ago
Text
Tumblr media
Jock JFK 🏈
-
(And he didn’t even scuff his loafers!)
171 notes · View notes
canisalbus · 9 months ago
Note
Different Italian anon, but the thing with Tuscan C is that it's pronounced like a very strong H sound, which is extra weird cuz the letter H makes no sound in Italian, normally. It sounds the way Spanish pronounce the J. We say it's "aspirato". So then people from there will say things like Hoha Hola (coca cola), and it's funny. It's also extremely contagious, I got family in Florence, you spend 3 days with them you start doing it too before you even realize.
.
186 notes · View notes
palmettoshenanigans · 2 months ago
Text
The thing is, "Nothing" isn't something that can feel the ache of loss or lack I think. Like,,, when you introduce things like "something" - where you can have a positive value - you can also have a negative value. You can have ten dollars, and you can owe someone ten dollars. You can have ten more than nothing, or you can have ten less than nothing. Zero becomes somewhat of a doorway i suppose? You never stop at zero and just rest there. Either you're in debt, or you want more. The only solution is to remove Things, Stuff, Etc from the equation. Can't have or owe anyone ten dollars if there be no dollars
When you choose to stop and sit there, at nothing, in the home of Zero, 'more' and 'less' cease to mean anything. Cease to affect you. To me this is oddly similar to the concept of Being Here Now, in the Present Moment, unconcerned with the hauntings of Yesterday or the threats of Tomorrow. I am Here. I Am. Here. Now. That's it.
Now feels very similar to Nothing. Not because there is an emptiness, but because there is a Radical Refusal to engage with ephemeral potentials and what-could-be's. They don't exist. What Is Here and Now exists.
when asked, "what do you want?" the response "nothing" doesn't mean 'there is nothing that i care to want', it means 'i am accepting of what i have Now, and i ask naught for anything else, lest I be distracted from what is Here'.
"Nothing" is like Radical Acceptance. It says "This is what Life has served me. This is what I'm working with. This is where I will focus my attention. Wishing for More of something Good or wishing for Less of something Bad will only serve to create more suffering within me. I choose instead to attend to the matters at hand. The good, the bad, and the ugly."
"I want nothing." == "I am accepting of what I have Now, and I ask naught for anything else."
"I am nothing." == "There are no titles labeling me Greater or Lesser - they are all false. I simply Am."
"This is nothing." == "There is no specialness that makes what is going on between us more or less than. We simply Are."
Andrew does not want. He will simply Be that which he Is, Here Now, with whomever is with him, and he will take them as they Are. And if what Am and Here and Now equates to is something good, well...
He'll take it.
63 notes · View notes
druidshollow · 1 year ago
Text
Tumblr media
someone left their creatures here (uncoloured under cut)
Tumblr media
306 notes · View notes
yuviur · 1 year ago
Text
Tumblr media
And then, Henry is holding them really tight, more for his security than theirs, and he walks out of the dungeon (ep 42)
I cannot be the only one who cried when the twins climbed Henry and sat on his shoulders like two loving pauldrons 🥺
319 notes · View notes
imerian · 3 months ago
Text
✷ Pedroscar matching phone charms ✷
Tumblr media Tumblr media Tumblr media Tumblr media
41 notes · View notes
fallofthecelestial · 1 year ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
253 notes · View notes
satans-knitwear · 1 day ago
Text
Walking around the Christmas decoration section at the garden center pointing at various little shiny items saying "I'd wear that."
My mom following behind me, shaking her head in resignation "I know."
21 notes · View notes
feniksido · 8 months ago
Text
Tumblr media Tumblr media
The Vampire and The Wolf
74 notes · View notes
stimboardboy · 11 months ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
red string of fate products
x - x - x | x - x - x | x - x - x
74 notes · View notes
wildstar25 · 9 months ago
Text
Tumblr media Tumblr media
MiqoMarch Day 23 - Midnight
With their intended voyage into the void only a few days out, Arsay thought it the upmost importance that she steal her partner away to Kugane, that they might share one more fond memory together should things not turn out the way they plan in the thirteenth. It was as they crossed the very same bridge the miqo'te had once sat on together two years prior when Arsay gifted Y'shtola with a bracelet matching that of her own. A token of endearment which, Arsay confessed, she would have given to her fellow scion back then, had nerves not gotten the best of her. While their relationship has undoubtedly changed since the initial purchase of the jewellery, the sentiment remained the same. Y'shtola was someone who Arsay loved dearly and she will forever be grateful to have the seeker's life intertwined with her own. No matter where their free spirits took them, they would always hold each other in their hearts. A promise Y'shtola was more than willing to keep. She slipped the the string of beads around her wrist without a second thought. They were never to come off, not even when the two decided to delay their return to Radz-at-Han in favour of a private bath at the dead of night.
#miqomarch#miqomarch 2024#ffxiv#y'shtola rhul#y'shtola x wol#wolshtola#arsay nun lore#arshtola#thanks to nhaneh for the body mod#i had to do some insane fov to get the moon and them in the same shot so sorry for the distortion#forcing arshtola lore into this prompt since idk when Ill ever get around to gposing the actual scene#this is between 6.1 and 6.2!#endwalker patch spoilers#i had the idea that arsay bought the Dai-ryumyaku bracelets from a vendor between 4.3 n 4.4 when shtola is off to the doman enclave#and arsay is like hey wait you should let me show you around kugane on the way over!#a fun friend date that ends with shtola finally accepting she has a crush on arsay and its terminal#and arsay having a single moment where she starts reflecting on feelings & thinks maybe she missed hanging out w/shtola more than she shoul#only to quickly butt that idea out of her head and continue being super normal#arsay notices these matching bracelets with red and purple string and shes like oh they are so cute and they look like#they belong in a pair it would be so sad if they were ever split up unexpectedly#i know ill buy them and give one to shtola wouldnt that be fun!#so she does that and then cant bring herself to give yshtola the damn thing because she starts second guessing herself#so arsay stashes the bracelets away and she started wearing hers later under her glove#fast forward to two years later and arsay finds the other one in one of her bags#and now shes dating yshtola and they are about to go somewhere super dangerous#what better time to tell your gf how much they have always meant to you#and what better way to do it than with a gift and some words spoken from the heart?#it was a little unconventional since arsay didnt really have marriage on the mind but it was a proposal in a sense#WOL posting#Arsay Nun
65 notes · View notes
gummi-ships · 1 year ago
Text
Tumblr media
Kingdom Hearts - 100 Acre Wood
201 notes · View notes
duskstars · 5 months ago
Text
Tumblr media
anhane week 2024 day 7: free day 💙🩷
28 notes · View notes
tixdixl · 26 days ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
🎶Nine Lives🎶
Did I just bust out a whole ass comic of how these two become official- despite not finishing the fics that establish their dynamic to begin with?
Yeah... Oops. Dont mind that my style is inconsistent as hell.
So some context, the two of them become friends due to getting up to shenanigans in Heartslabyul- i will have ficlets of this. I promise. And Che'nya starts taking a massive living to Xiáng. He starts realizing that the ghosty cricket bounces off his mischief well, will engage with his banter, and really vibes with his presence. As he starts showing interest in Xiáng and starts getting physically closer to him, Che'nya finds Xiáng is INCREDIBLY receptive. But... didnt realize that the bug was still reading it strictly platonic.
I will summarize a ficlet I wanna write that springs this on specifically. At some point, Che'nya starts visiting Scarabia to see Xiáng and Kalim notices how close they seem.
The encounter goes a lil something like this:
Kalim: Hey just curious!! Are you two boyfriends!?
Che'nya: maybe we are, maybe we aren't~
Kalim: Oh so you arent then?
Che'nya: >U no we are!!!!
Xiáng: ○_●;;; uh---
Xiáng is confused and actually distressed about it because he didnt know. He didnt know that Che'nya was showing interest- which doesnt help cause Xiáng was totally crushing on him. But because of the fact they didnt talk about it, and then Che'nya got wishy washy about it? This confrontation as seen in this comic happens. Again, I promise I will write this all out. Im just taking a little break from writing. ^^;
✨️✨️✨️
Tag list: @ramshacklerumble @the-trinket-witch @rainesol @elenauaurs @starry-night-rose
@cyanide-latte @winterweary @boopshoops @thehollowwriter @theleechyskrunkly
@lumdays @twstinginthewind @inmateofthemind
19 notes · View notes