Coding query: Difference between revisions

From Icelandic Parsed Historical Corpus (IcePaHC)
Jump to navigation Jump to search
Einarfs (talk | contribs)
No edit summary
Einarfs (talk | contribs)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
1. byrjum á að skilgreina leitarfyrirspurnina/-skilyrðin í einhverri skrá, t.d. test1.c
1. start by defining a query in a file, e.g. test1.c, then:


'''CS test1.c $ice'''
'''CS test1.c $ice''' (= ...icepahcv0.9/psd/*psd; edit aliases in .bashrc)


2. í annarri skrá, t.d. codes.q, eru skilyrði eins og "print_only: CODING*"
2. Now you have created test1.cod. Create another (empty) file, codes.q, and write "print_only: CODING*", then:


'''CS codes.q test1.cod'''
'''CS codes.q test1.cod'''


3. Nú ætti skráin test1.cod.ooo að vera til; hún inniheldur líklega aðallega b: (ef b er skilgreint sem "else")
3. Now you have created test.cod.ooo. Use grep to delete or search.


'''grep -v "x" extraposed.cod.ooo > temp.out'''
'''grep -v "x" extraposed.cod.ooo > temp.out''' [deletes x's]


4. Með -v er því eytt út sem leitað er að
'''grep -v "b" temp.out > dataset.out''' [deletes x's and pipes it in the file dataset.out]
 
'''grep -v "b" temp.out > dataset.out'''





Latest revision as of 09:34, 20 February 2020

1. start by defining a query in a file, e.g. test1.c, then:

CS test1.c $ice (= ...icepahcv0.9/psd/*psd; edit aliases in .bashrc)

2. Now you have created test1.cod. Create another (empty) file, codes.q, and write "print_only: CODING*", then:

CS codes.q test1.cod

3. Now you have created test.cod.ooo. Use grep to delete or search.

grep -v "x" extraposed.cod.ooo > temp.out [deletes x's]

grep -v "b" temp.out > dataset.out [deletes x's and pipes it in the file dataset.out]


gogn<-read.table("dataset.out",sep=":",header=T)

table(gogn$position,gogn$year,gogn$def)

table(gogn$position[gogn$def=="d"],gogn$year[gogn$def=="d"])