POST
|
Thank you very much, that did exactly what I needed. And I see that the new code had to be implemented where I thought it would be, but I must admit I haven't used validate that much with other tools in python. Is it just to check if the results from the tool is readable or that it gets data from the process?
... View more
01-22-2018
11:34 PM
|
0
|
1
|
542
|
POST
|
This is how it currently looks after using the script. As you can see with for example "Tverreggi" is matched against "eggi" and "egg". With the new method, it would only match against "eggi" since it wouldnt count the right side of the text as wildcard. This is what i want(below), where as in the first example "Tverrdalstind" matched against both "dal" and "tind", it will now only match against "tind", since "dal" is not the end of the word and the new search will only check for wildcards on the left side of the text in "Ordbok", so if it has text on the right, it won't match. The other example shows text from "Ordbok" with capital letter at the start and therefore matches against the first part of the text "Nordrelandet" and "Nordre" since it only will search for the right side wildcards. This will give me fewer and more precise matches that I can use. SNAVN OrdbokMatch Tverrelvmyra myra Tverrdalstind tind Nordrelandet Nordre Tverrdalstjønna tjønna Tverrdalselva elva
... View more
01-22-2018
06:26 AM
|
0
|
4
|
994
|
POST
|
Hello, again, I'm currently working with the data and it seems that I have to make some changes to the script, to adapt it to the new parameters. Currently I want to search all text from "Ordbok" that have lowercase text and uppercase text differently. All text that starts with lowercase will be matched against text from "Navn" that's to the left of them and not both sides like earlier. The other text that starts with uppercase will only be matched against any text that's to the right. I tried looking through the script, but I'm not that versatile in Python yet, so I couldn't see where i should put the code for this. I'm guessing it's where "def FindMatches(lst_items, lst_dct):" starts, but again, I'm not sure. It would help me better understand what the script does as well so i can edit it later if needed.
... View more
01-22-2018
05:36 AM
|
0
|
6
|
994
|
POST
|
I just saw that myself, but it seems that it works with removing space, but both will work fine. Thank you very much for your help, this will be very useful in future tasks as well.
... View more
01-19-2018
07:09 AM
|
0
|
0
|
994
|
POST
|
I found out why it happend now, I applied the changes you made, but also made a tiny change to where it replaces comma with space. The next line of code removes places with double space, which in turn merges words with comma since they now had double space from the earlier code. I can also mention that I got 340 000 matches, so it seems everything works as it should now. text = text.replace('"','')
text = text.replace(';',' ')
text = text.replace('-','')
text = text.replace(',','') #Changed, removed space
text = text.replace(' ','')
... View more
01-19-2018
06:58 AM
|
0
|
2
|
994
|
POST
|
I've run the code through all 400 000 records now, it only took around 10 minutes. But it seems that when removing comma it took the two words and merged them into one, so "ås, åsen" became "åsåsen", but other places the comma remained to so that the texts were treated as two separate words. I ended up with 40 000 matches, which i believe is a bit low, and I suspect it's because of that. But i can see if it's just an easy fix with space between the commas and text in the attributes. But this is really helpful nonetheless, thank you very much. EDIT: Looking over again, it seems none of the words separated by comma has been matched. Which explains why there are so few matches at least, it seems in the last part of the code when it removes comma, is when it goes wrong. text = text.replace(',','') and when it replaces space as well text = text.replace(' ',''). Is this part needed to read the text correctly? Or does it still read the two words separated by comma as unique texts if i remove these two?
... View more
01-19-2018
05:57 AM
|
0
|
4
|
994
|
POST
|
I'm uploading the FGDB here, I had to first compress it in ArcMap, and then ZIP it to make it smaller than 50 MB.
... View more
01-19-2018
12:21 AM
|
0
|
13
|
1469
|
POST
|
That's what i though, since I didn't see any arcpy import. I'll upload the FGDB in zip tomorrow, I've taken the liberty to remove a good amount of the fields in "Navn" to make it easier to read.
... View more
01-18-2018
07:09 AM
|
1
|
14
|
1469
|
POST
|
From what I can see from the result file, it looks really good. The matches are what i wanted, and takes all text that matches from "field" against "SNAVN". Can I replace the CSV files in the code, to compare 2 different file types? Since "Navn" is a Feature Class with annotations, and "Ordbok" is a Standalone Table. If so I can try and test the code towards more rows from "Navn" to see if the results are the same. But this is really good results, thank you very much.
... View more
01-18-2018
05:43 AM
|
0
|
17
|
1469
|
POST
|
I answered above about those in parenthesis, short answer, no they should not be compared. Mostly the text will be at the end of a name yes, but in some cases it will be in the middle or first, so the wildcard is needed to be sure. From what I can see in the example, it's the way I want to compare the columns. The only thing is that it's "field" that contains the text, since "Navn" is the alias in Arcmap, the real name is "field" in "Ordbok". Hope this helps.
... View more
01-17-2018
11:46 PM
|
0
|
19
|
1469
|
POST
|
The column named "field" from "Ordbok" is the one i want to compare to column "SNAVN" in "Navn" yes. Some will have same text some places in "field", but different diffraction. So both texts separated by comma must be compare with OR statement, so that they count both texts to a name. In "field" there are some accent marks, they can be ignored. Meaning the text is correct, but they have accent marks. I should've removed the accent marks when converting the file type, sorry about that. About those in parenthesis, they are as well something that can be ignored, since they only explain what the word means in a simplified text. The only text that should be taking into account from "field" is those that are separated by comma and don't have parenthesis around them.
... View more
01-17-2018
11:42 PM
|
0
|
0
|
1469
|
POST
|
The new output should show something like that yes, the text that is separated by comma in column1 is a diffraction of a word, that must both be checked against column2, as 1 object. So i need to have the code to treat comma as a delimiter to jump to next keyword. The ones in parenthesis is just a short explanation in other languages, not important for the actual search. Column1 is a dictionary, while column2 is a placename base for a large area. I'm uploading the files here, but only a portion(50 000) of the 400 000 in table2 since its too big.
... View more
01-17-2018
02:19 AM
|
0
|
3
|
1332
|
POST
|
Thank you for the example and help so far, I'm uploading 2 screenshots from the tables to give you a better understanding of what I'm trying to compare. Table1 is to the left and Table2 to the right.
... View more
01-15-2018
07:20 AM
|
0
|
4
|
1333
|
POST
|
I will create a new output of the matches in table1. Those that match will be used as a dictionary for the names in table2 in a map layout. How will i create a dictionary from the two fields? I have tried looking for that solution for a while.
... View more
01-15-2018
04:56 AM
|
0
|
11
|
2426
|
Title | Kudos | Posted |
---|---|---|
1 | 01-18-2018 07:09 AM |
Online Status |
Offline
|
Date Last Visited |
03-18-2025
01:54 PM
|