# Questions tagged [semantic-matching]

Posts about semantic pattern matching rather than syntactic pattern matching (which is the built-in pattern matcher of Mathematica) e.g. "Why x^3 /. x^2->a doesn't work!"

25 questions
Filter by
Sorted by
Tagged with
172 views

### Importing Specific Data from a Text File

I am quite new to Mathematica. I have a text file that upon importing has a repetitive structure with characters included. I need to extract only the following in numbers only (no letters, dash lines, ...
• 33
44 views

### Trouble with replacement rules for squared variables [duplicate]

I want to do replacement of products (because I am dealing with abstract projectors), but Mathematica seems to fail understanding this toy example replacement : ...
211 views

### How to Replace 'delta t' with 'a' in Mathematica Without Affecting Separate Instances of 'delta' or 't'?

In Mathematica, how can I replace instances of delta t in an expression with a, while keeping instances of ...
• 215
58 views

### How to replace polynomials numerically? [duplicate]

We know that the value of this equation is 0 x2 y1 - x1 y2 == 0 For the following equation, there is a correlation between the polynomial parts of the known ...
• 4,315
1 vote
109 views

• 1,610
697 views

### ReplaceAll (/.) not working as expected

I am trying to replace some variables in the form of n*wt with wt. However, I came across some cases where the ...
• 1,307
332 views

### Definition of a general rule

By defining: rule = Sqrt[expr_^2] :> expr; and writing: Sqrt[x^2] /. rule I get: x which is what is desired (...
• 4,452
42 views

### Parsing time interval strings as "Uncertain" Time Intervals

Problem: I have strings of form "[d1, d2]" or sometimes just [d1] where d1 and ...
• 3,145
1k views

### How to find multi-word synonyms?

I’m looking to write a semantic distance function for phrases (5 words or less) that can map multi-word synonyms together. My domain is e-commerce fashion - here are some required examples for a ...
• 31.5k
199 views

### Using Semantic Import to do an Excel-like VLookUp using Mathematica

I'm following an example provided in the following Stack Exchange Link but, using a different approach. My data is contained in an Excel workbook called "Input Workbook.xlsx" as shown here: I ...
352 views

### "Smart" substitution of subexpressions

I have the following question. An expression, which I want to simplify contains several subexpressions which appear quite frequently all over the place. To optimize simplification I would like to ...
• 245
141 views

### SemanticImport extremely slow with "Number" format

With the following definition: col = "num\n" <> StringRiffle[Table[i, {i, 1000}], "\n"]; I do not understand why the ...
• 1,215
199 views

### Sets of identical equality/inequalities

So I've used Mathematica for some months, but I never noticed this sort of thing about it, namely: (a > b) == (b < a) which are supposed to be identical ...
• 283
192 views

### Simplifying expressions

Let's define a function $\Omega(x,y)$ ...
• 8,790
763 views

### How to apply ReplaceAll to denominator?

Here is the simple task. In reality, it's far more complicated, but it comes down to this. I want to take the expression $\frac{y}{x^2}$ and replace $x^2$ with $k$. This doesn't work: ...
• 133