matching

Word matching in SQL Server

血红的双手。 提交于 2019-11-30 17:13:01
问题 I have a requirement to provide a suggested match between data in two database tables. The basic requirement is; - A "match" should be suggested for the highest number of matched words (irrespective of order) between the two columns in question. For example, given the data; Table A Table B 1,'What other text in here' 5,'Other text in here' 2,'What am I doing here' 6,'I am doing what here' 3,'I need to find another job' 7,'Purple unicorns' 4,'Other text in here' 8,'What are you doing in here'

compare row values over multiple rows (R)

巧了我就是萌 提交于 2019-11-30 16:34:18
I don't think this question has asked yet (most similar questions are about extracting data or returning a count). I am new to R, so any help would be appreciated! I have a dataset of multiple runs of an experiment in one file and the data looks like this, where i have all the time steps for each run in rows time [info] id (unique per run) I am attempting to calculate when the system reaches equilibrium, which I am defining as stable values in 3 interdependent parameters. I would like to have the contents of rows compared and if they are within 5% of each other over 20 timesteps, to return the

Difference between * and node() in XSLT

会有一股神秘感。 提交于 2019-11-30 12:58:28
问题 What's the difference between these two templates? <xsl:template match="node()"> <xsl:template match="*"> 回答1: <xsl:template match="node()"> is an abbreviation for: <xsl:template match="child::node()"> This matches any node type that can be selected via the child:: axis : element text-node processing-instruction (PI) node comment node. On the other side : <xsl:template match="*"> is an abbreviation for: <xsl:template match="child::*"> This matches any element . The XPath expression: someAxis:

Hungarian algorithm in Python

僤鯓⒐⒋嵵緔 提交于 2019-11-30 12:15:34
Is there good implementation of Hungarian algorithm in standard python libraries? jcomeau_ictx I just tried: pip install munkres and it worked. Here you can find a short explanation on how to use it. I got an error trying to install "hungarian". Check this munkres out There are multiple Options: pip install munkres Documentation here pip install hungarian Documentation here pip install scipy scipy.optimize.linear_sum_assignment Documentation here 来源: https://stackoverflow.com/questions/4075669/hungarian-algorithm-in-python

String searching algorithms in Java

假如想象 提交于 2019-11-30 10:35:03
I am doing string matching with big amount of data. EDIT: I am matching words contained in a big list with some ontology text files. I take each file from ontology, and search for a match between the third String of each file line and any word from the list. I made a mistake in overseeing the fact that what I need to do is not pure matching (results are poor), but I need some looser matching function that will also return results when the string is contained inside another string. I did this with a Radix Trie ; it was very fast and works nice, but now I guess my work is useless because a trie

Hungarian Algorithm and multiple factors

蓝咒 提交于 2019-11-30 10:12:12
I have a situation where I need to allocate people to several events. If we just had a price as a factor, it would be fine, but there is a number of factors that come in. First, some background. This is for a non-profit organization that promotes story hours for children that are hospitalized for any reason, so they depend on voluntary work to do so. So, since they rely on people's good will, they give people as much work as people can / want to do, which varies like: Some people can only do mornings, and some other people can only do afternoons; Some people can only do Mondays, and Thursdays,

Matching dates with regular expressions in Python?

孤者浪人 提交于 2019-11-30 09:26:15
I know that there are similar questions to mine that have been answered, but after reading through them I still don't have the solution I'm looking for. Using Python 3.2.2, I need to match "Month, Day, Year" with the Month being a string, Day being two digits not over 30, 31, or 28 for February and 29 for February on a leap year. (Basically a REAL and Valid date) This is what I have so far: pattern = "(January|February|March|April|May|June|July|August|September|October|November|December)[,][ ](0[1-9]|[12][0-9]|3[01])[,][ ]((19|20)[0-9][0-9])" expression = re.compile(pattern) matches =

Match elements between 2 collections with Linq in c#

佐手、 提交于 2019-11-30 06:17:29
i have a question about how to do a common programming task in linq. lets say we have do different collections or arrays. What i would like to do is match elements between arrays and if there is a match then do something with that element. eg: string[] collection1 = new string[] { "1", "7", "4" }; string[] collection2 = new string[] { "6", "1", "7" }; foreach (string str1 in collection1) { foreach (string str2 in collection2) { if (str1 == str2) { // DO SOMETHING EXCITING/// } } } This can obviously be accomplished using the code above but what i am wondering if there is a fast and neat way

Difference between * and node() in XSLT

爷,独闯天下 提交于 2019-11-30 04:37:48
What's the difference between these two templates? <xsl:template match="node()"> <xsl:template match="*"> <xsl:template match="node()"> is an abbreviation for: <xsl:template match="child::node()"> This matches any node type that can be selected via the child:: axis : element text-node processing-instruction (PI) node comment node. On the other side : <xsl:template match="*"> is an abbreviation for: <xsl:template match="child::*"> This matches any element . The XPath expression: someAxis::* matches any node of the primary node-type for the given axis. For the child:: axis the primary node-type

Approximate string matching

穿精又带淫゛_ 提交于 2019-11-30 03:58:55
I know this question have been asked a lot of time. I want a suggestion on which algorithm is suitable for approximate string matching. The application is specifically for company name matching only and nothing else. The biggest challenge is probably the company end name part and short named part Example: 1. companyA pty ltd vs companyA pty. ltd. vs companyA 2. WES Engineering vs W.E.S. Engineering (extremely rare occurance) Do you think Levenshtein Edit Distance is adequate? I'm using C# Regards, Max hashable There are various string distance metrics you could use. I would recommend Jaro