Skip to content

Instantly share code, notes, and snippets.

@martin12333
Created July 31, 2019 07:53
Show Gist options
  • Save martin12333/5dbf279c0ba5a5a3259a588450ad1577 to your computer and use it in GitHub Desktop.
Save martin12333/5dbf279c0ba5a5a3259a588450ad1577 to your computer and use it in GitHub Desktop.
(a recorded "macro") ... openrefine ... rowsnotrecords-flagged-fontmap leftjoined to YACR leftjoined to 21 e1len meanings_n BCI AV_2018 04 16_updated_2018 0419 en sv no fi hu de nl af ru lv po fr es pt it dk derivations xls
OpenRefine kopie rowsnotrecords-pozorflagged-fontmap leftjoined to YACR leftjoined to 21 e1len meanings_n BCI AV_2018 04 16_updated_2018 0419 en sv no fi hu de nl af ru lv po fr es pt it dk derivations xls Permalink Open... Export Help
Facet / FilterUndo / Redo 45
Extract…Apply…
Filter:
0.Create project
1.Text transform on 0 cells in column Derivation - explanation: grel:value.replace(/\t/,' --- ')
2.Text transform on 0 cells in column Derivation - explanation: grel:value.replace(/\n/,' --- ')
3.Create new column loc_img based on column English by filling 5835 rows with grel:'http://127.0.0.1:3333/images/blissymbolics.org/bliss_h_transp_png/'+cells.English.value.escape('url')+'.png'
4.Move column loc_img to position 3
5.Rename column loc_img to local_img
6.Create new column engl1 based on column English by filling 5835 rows with grel:value.replace(/[(][^)]*[)]/,'()')
7.Text transform on 90 cells in column engl1: grel:value.replace(/[-_()]*[,]/,',')
8.Text transform on 1764 cells in column engl1: grel:value.replace(/[-_()]*$/,'')
9.Split multi-valued cells in column engl1
10.Fill down 2774 cells in column BCI-AV#
11.Fill down 2774 cells in column English
12.Fill down 2774 cells in column POS
13.Fill down 2774 cells in column local_img
14.Fill down 2774 cells in column Derivation - explanation
15.Fill down 2774 cells in column BCI-AV#2
16.Fill down 3021 cells in column Swedish
17.Fill down 3023 cells in column German
18.Fill down 3021 cells in column Russian
19.Fill down 3938 cells in column French
20.Create new column meanings_n based on column engl1 by filling 8609 rows with grel:cell.cross("engl1", "engl1").length()
21.Create new column e1length based on column engl1 by filling 8609 rows with grel:length(value)
22.Create new column Freq based on column engl1 by filling 1043 rows with grel:cell.cross("YACR_rank", "engl1").cells["Freq."].value[0]
23.Create new column unichr based on column BCI-AV# by filling 0 rows with grel:cell.cross("fontMap-bliss-refine", "BCI").cells["unichr"].value[0]
24.Create new column bc-str based on column BCI-AV# by filling 8609 rows with grel:value
25.Rename column bc-str to bci-str
26.Text transform on 8609 cells in column bci-str: value.toString()
27.Create new column unichr2 based on column bci-str by filling 7397 rows with grel:cell.cross("fontMap-bliss-refine", "bci-str").cells["unichr"].value[0]
28.Remove column unichr
29.Remove column bci-str
30.Move column local_img to position 0
31.Move column unichr2 to position 1
32.Move column unichr2 to position 0
33.Move column engl1 to position 3
34.Move column Freq to position 41
35.Move column e1length to position 41
36.Flag row 78
37.Flag row 1717
38.Flag row 1720
39.Flag row 3778
40.Flag row 3780
41.Flag row 3782
42.Flag row 3784
43.Flag row 44
44.Move column engl1 to position 0
45.Create new column engl1_unichr2 based on column engl1 by filling 7397 rows with grel:value+'_'+cells.unichr2.value
'
8609 rowsExtensions:
Show as: rowsrecordsShow: 5102550 rows
« first‹ previous 1 - 10 next ›last »
All
engl1
engl1_unichr2
unichr2
local_img
BCI-AV#
English
meanings_n
POS
Derivation - explanation
BCI-AV#2
Swedish
BCI-AV#3
Norwegian
BCI-AV#4
Finnish
BCI-AV#5
Hungarian
BCI-AV#6
German
BCI-AV#7
Dutch
BCI-AV#8
Afrikaans
BCI-AV#9
Russian
BCI-AV#10
Latvian
BCI-AV#11
Polish
BCI-AV#12
French
BCI-AV#13
Spanish
BCI-AV#14
Portugese - draft
BCI-AV#15
Italian - draft
BCI-AV#16
Danish - draft
Column
Column2
Freq
e1length
[
{
"op": "core/text-transform",
"description": "Text transform on cells in column Derivation - explanation using expression grel:value.replace(/\\t/,' --- ')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Derivation - explanation",
"expression": "grel:value.replace(/\\t/,' --- ')",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column Derivation - explanation using expression grel:value.replace(/\\n/,' --- ')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Derivation - explanation",
"expression": "grel:value.replace(/\\n/,' --- ')",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/column-addition",
"description": "Create column loc_img at index 2 based on column English using expression grel:'http://127.0.0.1:3333/images/blissymbolics.org/bliss_h_transp_png/'+cells.English.value.escape('url')+'.png'",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "loc_img",
"columnInsertIndex": 2,
"baseColumnName": "English",
"expression": "grel:'http://127.0.0.1:3333/images/blissymbolics.org/bliss_h_transp_png/'+cells.English.value.escape('url')+'.png'",
"onError": "set-to-blank"
},
{
"op": "core/column-move",
"description": "Move column loc_img to position 3",
"columnName": "loc_img",
"index": 3
},
{
"op": "core/column-rename",
"description": "Rename column loc_img to local_img",
"oldColumnName": "loc_img",
"newColumnName": "local_img"
},
{
"op": "core/column-addition",
"description": "Create column engl1 at index 2 based on column English using expression grel:value.replace(/[(][^)]*[)]/,'()')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "engl1",
"columnInsertIndex": 2,
"baseColumnName": "English",
"expression": "grel:value.replace(/[(][^)]*[)]/,'()')",
"onError": "set-to-blank"
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column engl1 using expression grel:value.replace(/[-_()]*[,]/,',')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "engl1",
"expression": "grel:value.replace(/[-_()]*[,]/,',')",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column engl1 using expression grel:value.replace(/[-_()]*$/,'')",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "engl1",
"expression": "grel:value.replace(/[-_()]*$/,'')",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/multivalued-cell-split",
"description": "Split multi-valued cells in column engl1",
"columnName": "engl1",
"keyColumnName": "BCI-AV#",
"mode": "separator",
"separator": ",",
"regex": false
},
{
"op": "core/fill-down",
"description": "Fill down cells in column BCI-AV#",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "BCI-AV#"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column English",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "English"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column POS",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "POS"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column local_img",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "local_img"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column Derivation - explanation",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Derivation - explanation"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column BCI-AV#2",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "BCI-AV#2"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column Swedish",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Swedish"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column German",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "German"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column Russian",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "Russian"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column French",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "French"
},
{
"op": "core/column-addition",
"description": "Create column meanings_n at index 3 based on column engl1 using expression grel:cell.cross(\"engl1\", \"engl1\").length()",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "meanings_n",
"columnInsertIndex": 3,
"baseColumnName": "engl1",
"expression": "grel:cell.cross(\"engl1\", \"engl1\").length()",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column e1length at index 3 based on column engl1 using expression grel:length(value)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "e1length",
"columnInsertIndex": 3,
"baseColumnName": "engl1",
"expression": "grel:length(value)",
"onError": "store-error"
},
{
"op": "core/column-addition",
"description": "Create column Freq at index 3 based on column engl1 using expression grel:cell.cross(\"YACR_rank\", \"engl1\").cells[\"Freq.\"].value[0]",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Freq",
"columnInsertIndex": 3,
"baseColumnName": "engl1",
"expression": "grel:cell.cross(\"YACR_rank\", \"engl1\").cells[\"Freq.\"].value[0]",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column unichr at index 1 based on column BCI-AV# using expression grel:cell.cross(\"fontMap-bliss-refine\", \"BCI\").cells[\"unichr\"].value[0]",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "unichr",
"columnInsertIndex": 1,
"baseColumnName": "BCI-AV#",
"expression": "grel:cell.cross(\"fontMap-bliss-refine\", \"BCI\").cells[\"unichr\"].value[0]",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column bc-str at index 1 based on column BCI-AV# using expression grel:value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "bc-str",
"columnInsertIndex": 1,
"baseColumnName": "BCI-AV#",
"expression": "grel:value",
"onError": "set-to-blank"
},
{
"op": "core/column-rename",
"description": "Rename column bc-str to bci-str",
"oldColumnName": "bc-str",
"newColumnName": "bci-str"
},
{
"op": "core/text-transform",
"description": "Text transform on cells in column bci-str using expression value.toString()",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "bci-str",
"expression": "value.toString()",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
},
{
"op": "core/column-addition",
"description": "Create column unichr2 at index 2 based on column bci-str using expression grel:cell.cross(\"fontMap-bliss-refine\", \"bci-str\").cells[\"unichr\"].value[0]",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "unichr2",
"columnInsertIndex": 2,
"baseColumnName": "bci-str",
"expression": "grel:cell.cross(\"fontMap-bliss-refine\", \"bci-str\").cells[\"unichr\"].value[0]",
"onError": "set-to-blank"
},
{
"op": "core/column-removal",
"description": "Remove column unichr",
"columnName": "unichr"
},
{
"op": "core/column-removal",
"description": "Remove column bci-str",
"columnName": "bci-str"
},
{
"op": "core/column-move",
"description": "Move column local_img to position 0",
"columnName": "local_img",
"index": 0
},
{
"op": "core/column-move",
"description": "Move column unichr2 to position 1",
"columnName": "unichr2",
"index": 1
},
{
"op": "core/column-move",
"description": "Move column unichr2 to position 0",
"columnName": "unichr2",
"index": 0
},
{
"op": "core/column-move",
"description": "Move column engl1 to position 3",
"columnName": "engl1",
"index": 3
},
{
"op": "core/column-move",
"description": "Move column Freq to position 41",
"columnName": "Freq",
"index": 41
},
{
"op": "core/column-move",
"description": "Move column e1length to position 41",
"columnName": "e1length",
"index": 41
},
{
"op": "core/column-move",
"description": "Move column engl1 to position 0",
"columnName": "engl1",
"index": 0
},
{
"op": "core/column-addition",
"description": "Create column engl1_unichr2 at index 1 based on column engl1 using expression grel:value+'_'+cells.unichr2.value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "engl1_unichr2",
"columnInsertIndex": 1,
"baseColumnName": "engl1",
"expression": "grel:value+'_'+cells.unichr2.value",
"onError": "set-to-blank"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment