I have a google spreadsheet which I'm building as a template. Copies of the template will be made for multiple groups, so any formula/formatting needs to carry over. I have an issue which I thought was simple enough but after scouring for days I haven't come across a solution that's worked for this scenario. I want to take the relevant text and have the format repeat every time there's a value in a corresponding column.
I have a growing list of Test Words in Column A. I have managed to make each individual Test Word repeat three times vertically into Column B. There's also a set of three Values per Test Word in Column C. So columns A and B currently look like this (Please ignore the "- - -" I don't know how else to format it so it looks like two separate columns):
Test Word1 - - - Value 1
Test Word1 - - - Value 2
Test Word1 - - - Value 3
I need this to auto-populate every time a new Test Word is added:
+Test +Word1 - - - Value1
Test Word1 - - - - - Value2
Test Word1 - - - - - Value3
+Test +Word2 - - - Value1
Test Word2 - - - - - Value2
Test Word2 - - - - - Value3
+Test +Word3 - - - Value1
Test Word3 - - - - - Value2
Test Word3 - - - - - Value3
I've tried different variations of arrayformula, transpose/split/rept. That's not to say those types of formula won't work, just that they haven't with the particular ways I've tried. If it helps, I've laid it out in a viewable sheet here.
Any help is SUPER appreciated!
I'm new at this, but I may have part of the answer. If you use this formula in column D on row 3 (and fill down), it will create the output you seem to want, as shown in column E:
=IF(MOD(ROW(),3)=0,
"+" & SUBSTITUTE(INDEX(A$3:A,QUOTIENT(ROW(C3),3),1)," "," +"),
INDEX(A$3:A,QUOTIENT(ROW(C3),3),1))
I've added this in a new tab, Sheet1-GK in your spreadsheet.
This handles your test words. I'm not sure where you are getting the three value words that have to be matched with each test word. If they are kept somewhere else, they could be found using a VLOOKUP. Let me know if you need more help.
Are the three values the same for each different test word?
You show "Value1", "Value2", and "Value3" beside all of the test words. I assume that those could really be different, like "Value9", or "Value97" or whatever?
These formulas do need to be copied down the whole column. It is likely that this could be done with an ARRAYFORMULA using VLOOKUP. I could try to get that working, if that is important to you.
Related
I've two sets of corrupted numbers where two columns of data got merged.
1.504.99
4.604.97
18.955.00
1.154.85
0.301.82
And Like this:
0.0514.29%
0.1530.00%
0.2583.33%
0.000.00%
1.30185.71%
I want to split the each column two digits after the first dot for example 1.30185.71% as 1.30 | 185.71%
I tried split and regexreplace inside arrayformula as a noob as much as I can but as of now, nothing is working. Is there any way to make this work? Please help. Sheet is attached here
Try
1st
=arrayformula(if(A2:A="",,regexextract(A2:A,"\d+\.\d{2}")))
and 2nd
=arrayformula(if(A2:A="",,regexextract(A2:A,"\d+\.\d{2}(.*)")))
edit
you can add value to tranform in numeric, 1st
=arrayformula(if(A2:A="",,value(regexextract(A2:A,"\d+\.\d{2}"))))
and 2nd
=arrayformula(if(A2:A="",,value(regexextract(A2:A,"\d+\.\d{2}(.*)"))))
I have used lookup table and synonyms, but the entities mentioned in the lookup are not detected by RASA, neither synonyms worked.
nlu:
- intent: place_order
examples: |
- wanna [large](size) shoes for husky
- need a [small](size) size [green](color) boots for pupps
- have [blue](color) socks
- would like to place an order
- lookup: size
examples: |
- small
-medium
-large
- synonym: small
examples: |
- small
- s
- tiny
- synonym: large
examples: |
- large
- l
- big
- synonym: medium
examples: |
- medium
- m
- average
- normal
- lookup: color
examples: |
- black
- blue
- white
- red
- green
- orange
- yellow
- purple
It works correctly for "I would like to place an order for large blue shoes" , but if the input is "medium"(which is the lookup table) instead , it wont recognize
it wont work if synonyms of "large" like "big" is used.
After doing some research I found out using RegexEntityExtractor in pipeline will resolve the issue of lookup table
name: RegexEntityExtractor
But still it didn't resolved the problem of synonyms, and by default it was using DIETClassifier (which i think is pretty good intent and entity extractor) and the output of RegexEnityExtractor collided when I used it along with it.
Can someone suggest an Extractor or combination of extractor (intent and entity) such that it works well with lookup and synonyms without any conflicts?
Say I have a YML file original.yml with an array of objects
array_in_yml:
- start: 1
- middle: 2
- end: 3
I included it in modified.yml
!include "original.yml"
array_in_yml: []
I am expecting this array to be empty when I load the modified.yml, but it seems to have 3 values as original.yml. How do I force/override the array to be empty?
The discussion about !include seems to lead a bit away from the actual question. Let's assume that in some unknown way, the !include line gets replaced with the content in original.yml. We would have:
array_in_yml:
- start: 1
- middle: 2
- end: 3
array_in_yml: []
This is not valid YAML, since every key in a dictionary must be unique, but you use the key array_in_yml twice. Your YAML processor might ignore this and simply assign the first value (which is a sequence of three items) to the key array_in_yml.
Now the important part: There is no way in YAML to modify previously given values. You cannot override a value given previously with a different one. What you want to do is outside the YAML spec and you would need some merging tool that does such replacements for you.
I am wanting to solve this problem, but am kind of unsure how to correctly structure the logic for doing this. I am given a list of user names and I am told to find an extracted name for that. So, for example, I'll see a list of user names such as this:
jason
dooley
smith
rob.smith
kristi.bailey
kristi.betty.bailey
kristi.b.bailey
robertvolk
robvolk
k.b.dula
kristidula
kristibettydula
kristibdula
kdula
kbdula
alexanderson
caesardv
joseluis.lopez
jbpritzker
jean-luc.vey
dvandewal
malami
jgarciathome
christophertroethlisberger
How can I then turn each user name into an extracted name? The only parameter I am given is that every user name is guaranteed to have at least a partial person's name.
So for example, kristi.bailey would be turned into "Kristi Bailey"
alexanderson would be turned into "Alex Anderson"
So, the pattern I see is that, if I see a period I will turn that into two strings (possibly a first and last name). If I see three periods then it will be first, middle. The problem I am having trouble finding the logic for is when the name is just clumped up together like alexanderson or jgarciathome. How can I turn that into an extracted name? I was thinking of doing something like if I see 2 consonants and a vowel in a row I would separate the names, but I don't think that'll work.
Any ideas?
I'd use a string.StartsWith method and a string.EndsWith method and determine the maximum overlap on each. As long as it's more than 2 characters, call that the common name. Sort them into buckets based on the common name. It's a naive implementation, but it that's where I'd start.
Example:
string name1 = "kristi.bailey";
string name2 = "kristi.betty.bailey";
// We've got a 6 character overlap for first name:
name2.StartsWith(name1.Substring(0,6)) // this is true
// We've got a 6 character overlap for last name:
name2.EndsWith(name1.Substring(7)) // this is true
HTH!
Is there a way to make the following YAML shorter so that the same resources aren't repeated?
---
classes:
- roles::storage::nfs
samba::config::includeconf:
- alpha
- beta
- charlie
- delta
- echo
- foxtrot
smb_shares:
alpha:
name: alpha
beta:
name: beta
charlie:
name: charlie
delta:
name: delta
echo:
name: echo
path: /path/to/file
foxtrot:
name: foxtrot
If there's a way to reduce any of the repetition, that would be great. Ideally, each resource name would only appear once.
Yes you can vastly reduce this with two optimisations, one of which nullifies most of the effect of the other. You will however have to change your program from reading in simple sequences and mappings to create smarter objects ( which I called ShareInclude, Shares and Share):
---
classes:
- roles::storage::nfs
samba::config::includeconf: !ShareInclude
- alpha
- beta
- charlie
- delta
- echo
- foxtrot
smb_shares: !Shares
echo: !Share
path: /path/to/file
When creating ShareInclude, you should create a Share for each sequence element with an initial name being the same as the scalar value and insert this in some global list.
The above takes care of most of the Share object, execept info. When
echo: !Share
path: /path/to/file
is processed a temporary anonymous Share should be created with path set as an attribute or other retrievable value (if the name would be different that could be stored as well). Then once Shares is created it will know the name of the share to look up (echo from the key of the mapping) and take one of two actions:
If the name can be looked up, update the Share object with the information from the anonymous Share
If the name cannot be found, promote the anonymous share by providing the key value as its name, and store it.
This way you have to specify echo twice, otherwise there is no way to associate the explicit path with the specific Share object created when processing ShareInclude. If that is still too much you can approach it from the other way and leave ShareInclude empty and implicitly make those entries when dealing with Shares:
---
classes:
- roles::storage::nfs
samba::config::includeconf: !ShareInclude
smb_shares: !Shares
alpha:
beta:
charlie:
delta:
echo:
path: /path/to/file
foxtrot:
Although this is somewhat shorter, depending on your YAML parser, you might no longer have a guaranteed ordering in the creation of the Share object. And if you have to make Shares into a sequence of key-value pairs the shortening advantage is gone.