projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
01f3548
)
DISPLAY DICTIONARY: Add "Label: " prefix for variable labels in output.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 22 Dec 2013 19:10:49 +0000
(11:10 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 22 Dec 2013 19:10:49 +0000
(11:10 -0800)
Bug #40864.
perl-module/t/Pspp.t
patch
|
blob
|
history
src/language/dictionary/sys-file-info.c
patch
|
blob
|
history
tests/data/sys-file-reader.at
patch
|
blob
|
history
tests/data/sys-file.at
patch
|
blob
|
history
tests/language/stats/rank.at
patch
|
blob
|
history
tests/perl-module.at
patch
|
blob
|
history
diff --git
a/perl-module/t/Pspp.t
b/perl-module/t/Pspp.t
index a2d42889892b580b4a7c08d63fab8e98376ec591..e3ee08def884edd2932623cbcb39731b89bc5d86 100644
(file)
--- a/
perl-module/t/Pspp.t
+++ b/
perl-module/t/Pspp.t
@@
-250,7
+250,7
@@
GET FILE='$tempfile'.
DISPLAY DICTIONARY.
SYNTAX
Variable,Description,,Position
DISPLAY DICTIONARY.
SYNTAX
Variable,Description,,Position
-integer,My Integer,,1
+integer,
Label:
My Integer,,1
,Format: F8.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F8.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-259,7
+259,7
@@
integer,My Integer,,1
,0,Zero,
,1,Unity,
,2,Duality,
,0,Zero,
,1,Unity,
,2,Duality,
-string,My String,,2
+string,
Label:
My String,,2
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
@@
-267,7
+267,7
@@
string,My String,,2
,"Missing Values: ""this ""; ""that """,,
,xx ,foo,
,yy ,bar,
,"Missing Values: ""this ""; ""that """,,
,xx ,foo,
,yy ,bar,
-longstring,My Long String,,3
+longstring,
Label:
My Long String,,3
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
diff --git
a/src/language/dictionary/sys-file-info.c
b/src/language/dictionary/sys-file-info.c
index c7f326f3be7f673fb7b5918785ca08093a24923f..d26c236e8f026337e31e01b1fe02489375108842 100644
(file)
--- a/
src/language/dictionary/sys-file-info.c
+++ b/
src/language/dictionary/sys-file-info.c
@@
-481,7
+481,11
@@
describe_variable (const struct variable *v, struct tab_table *t, int r,
if (flags & DF_VARIABLE_LABELS && var_has_label (v))
{
if (flags & DF_VARIABLE_LABELS && var_has_label (v))
{
- tab_joint_text (t, 1, r, 2, r, TAB_LEFT, var_get_label (v));
+ if (flags & ~(DF_DICT_INDEX | DF_VARIABLE_LABELS))
+ tab_joint_text_format (t, 1, r, 2, r, TAB_LEFT,
+ _("Label: %s"), var_get_label (v));
+ else
+ tab_joint_text (t, 1, r, 2, r, TAB_LEFT, var_get_label (v));
r++;
}
r++;
}
diff --git
a/tests/data/sys-file-reader.at
b/tests/data/sys-file-reader.at
index 8a700ad92b7cfe037c67743d481cf4165f3cb489..60d5ff705430c9fa14d2ea620d54c78007828a65 100644
(file)
--- a/
tests/data/sys-file-reader.at
+++ b/
tests/data/sys-file-reader.at
@@
-140,11
+140,11
@@
File label: PSPP synthetic test file: ôõöø
Variable,Description,,Position
num1,Format: F8.0,,1
Variable,Description,,Position
num1,Format: F8.0,,1
-num2,Numeric variable 2's label (ùúû),,2
+num2,
Label:
Numeric variable 2's label (ùúû),,2
,Format: F8.0,,
num3,Format: F8.0,,3
,Missing Values: 1,,
,Format: F8.0,,
num3,Format: F8.0,,3
,Missing Values: 1,,
-num4,Another numeric variable label,,4
+num4,
Label:
Another numeric variable label,,4
,Format: F8.0,,
,Missing Values: 1,,
num5,Format: F8.0,,5
,Format: F8.0,,
,Missing Values: 1,,
num5,Format: F8.0,,5
@@
-160,11
+160,11
@@
num9,Format: F8.0,,9
numàèìñò,Format: F8.0,,10
,Missing Values: LOWEST THRU 1; 5,,
str1,Format: A4,,11
numàèìñò,Format: F8.0,,10
,Missing Values: LOWEST THRU 1; 5,,
str1,Format: A4,,11
-str2,String variable 2's label,,12
+str2,
Label:
String variable 2's label,,12
,Format: A4,,
str3,Format: A4,,13
,"Missing Values: ""MISS""",,
,Format: A4,,
str3,Format: A4,,13
,"Missing Values: ""MISS""",,
-str4,Another string variable label,,14
+str4,
Label:
Another string variable label,,14
,Format: A4,,
,"Missing Values: ""OTHR""",,
str5,Format: A4,,15
,Format: A4,,
,"Missing Values: ""OTHR""",,
str5,Format: A4,,15
@@
-179,7
+179,7
@@
str9,Format: A10,,19
,"Missing Values: ""abcdefgh""; ""01234567""",,
str10,Format: A11,,20
,"Missing Values: ""abcdefgh""; ""01234567""; ""0 """,,
,"Missing Values: ""abcdefgh""; ""01234567""",,
str10,Format: A11,,20
,"Missing Values: ""abcdefgh""; ""01234567""; ""0 """,,
-str11,25-byte string,,21
+str11,
Label:
25-byte string,,21
,Format: A25,,
Table: Data List
,Format: A25,,
Table: Data List
@@
-232,7
+232,7
@@
LIST.
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
Variable,Description,,Position
num1,Format: F8.0,,1
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
Variable,Description,,Position
num1,Format: F8.0,,1
-num2,Numeric variable 2's label,,2
+num2,
Label:
Numeric variable 2's label,,2
,Format: F8.0,,
Table: Data List
,Format: F8.0,,
Table: Data List
@@
-288,7
+288,7
@@
LIST.
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
Variable,Description,,Position
num1,Format: F8.0,,1
AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
Variable,Description,,Position
num1,Format: F8.0,,1
-num2,Numeric variable 2's label,,2
+num2,
Label:
Numeric variable 2's label,,2
,Format: F8.0,,
Table: Data List
,Format: F8.0,,
Table: Data List
diff --git
a/tests/data/sys-file.at
b/tests/data/sys-file.at
index 9b8986d589c5eb17bac3837aee9aa2519f293903..033a7da9af414433bffaeb970c8ce8263e7f3a59 100644
(file)
--- a/
tests/data/sys-file.at
+++ b/
tests/data/sys-file.at
@@
-502,7
+502,7
@@
Variable,Description,,Position
,1.00,éclair élan,
,Custom attributes:,,
,Atatürk,Düsseldorf Gewürztraminer,
,1.00,éclair élan,
,Custom attributes:,,
,Atatürk,Düsseldorf Gewürztraminer,
-roué,Provençal soupçon,,2
+roué,
Label:
Provençal soupçon,,2
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
diff --git
a/tests/language/stats/rank.at
b/tests/language/stats/rank.at
index f47d23e861cf04ce989750623c016f31908ca1dd..d29e2e8df6124fc86e4b5d66352423557073fe39 100644
(file)
--- a/
tests/language/stats/rank.at
+++ b/
tests/language/stats/rank.at
@@
-126,32
+126,32
@@
b,Format: F8.2,,2
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-Ra,RANK of a,,3
+Ra,
Label:
RANK of a,,3
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-RFR001,RFRACTION of a,,4
+RFR001,
Label:
RFRACTION of a,,4
,Format: F6.4,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: F6.4,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-count,N of a,,5
+count,
Label:
N of a,,5
,Format: F6.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: F6.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-Rb,RANK of b,,6
+Rb,
Label:
RANK of b,,6
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-RFR002,RFRACTION of b,,7
+RFR002,
Label:
RFRACTION of b,,7
,Format: F6.4,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: F6.4,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-Nb,N of b,,8
+Nb,
Label:
N of b,,8
,Format: F6.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F6.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-543,7
+543,7
@@
ran003,Format: F8.2,,3
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-RAN001,RANK of foo,,4
+RAN001,
Label:
RANK of foo,,4
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F9.3,,
,Measure: Scale,,
,Display Alignment: Right,,
diff --git
a/tests/perl-module.at
b/tests/perl-module.at
index eee9ac99477ee78a2dc1137a9eb491870a9467d9..0ddd8fd5ff54e698ce8554c3a6ae72dce73bc3fe 100644
(file)
--- a/
tests/perl-module.at
+++ b/
tests/perl-module.at
@@
-237,7
+237,7
@@
DISPLAY DICTIONARY.
])
AT_CHECK([pspp -O format=csv dump-dict.sps], [0],
[Variable,Description,,Position
])
AT_CHECK([pspp -O format=csv dump-dict.sps], [0],
[Variable,Description,,Position
-integer,My Integer,,1
+integer,
Label:
My Integer,,1
,Format: F8.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F8.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-246,7
+246,7
@@
integer,My Integer,,1
,0,Zero,
,1,Unity,
,2,Duality,
,0,Zero,
,1,Unity,
,2,Duality,
-string,My String,,2
+string,
Label:
My String,,2
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
@@
-254,7
+254,7
@@
string,My String,,2
,"Missing Values: ""this ""; ""that """,,
,xx ,foo,
,yy ,bar,
,"Missing Values: ""this ""; ""that """,,
,xx ,foo,
,yy ,bar,
-longstring,My Long String,,3
+longstring,
Label:
My Long String,,3
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A9,,
,Measure: Nominal,,
,Display Alignment: Left,,
@@
-457,7
+457,7
@@
LIST.
])
AT_CHECK([pspp -O format=csv dump-dicts.sps], [0],
[[Variable,Description,,Position
])
AT_CHECK([pspp -O format=csv dump-dicts.sps], [0],
[[Variable,Description,,Position
-string,A Short String Variable,,1
+string,
Label:
A Short String Variable,,1
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
@@
-466,12
+466,12
@@
string,A Short String Variable,,1
,1111 ,ones,
,2222 ,twos,
,3333 ,threes,
,1111 ,ones,
,2222 ,twos,
,3333 ,threes,
-longstring,A Long String Variable,,2
+longstring,
Label:
A Long String Variable,,2
,Format: A12,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Display Width: 12,,
,Format: A12,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Display Width: 12,,
-numeric,A Numeric Variable,,3
+numeric,
Label:
A Numeric Variable,,3
,Format: F10.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F10.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-486,17
+486,17
@@
numeric,A Numeric Variable,,3
,colour[3],violet,
,nationality,foreign,
,size,large,
,colour[3],violet,
,nationality,foreign,
,size,large,
-date,A Date Variable,,4
+date,
Label:
A Date Variable,,4
,Format: DATE11,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: DATE11,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-dollar,A Dollar Variable,,5
+dollar,
Label:
A Dollar Variable,,5
,Format: DOLLAR11.2,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: DOLLAR11.2,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-datetime,A Datetime Variable,,6
+datetime,
Label:
A Datetime Variable,,6
,Format: DATETIME17.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: DATETIME17.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-511,7
+511,7
@@
string,longstring,numeric,date,dollar,datetime
5555 ,Five ,5,05-MAY-2005,$5.00,05-MAY-2005 05:05
Variable,Description,,Position
5555 ,Five ,5,05-MAY-2005,$5.00,05-MAY-2005 05:05
Variable,Description,,Position
-string,A Short String Variable,,1
+string,
Label:
A Short String Variable,,1
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Format: A8,,
,Measure: Nominal,,
,Display Alignment: Left,,
@@
-520,12
+520,12
@@
string,A Short String Variable,,1
,1111 ,ones,
,2222 ,twos,
,3333 ,threes,
,1111 ,ones,
,2222 ,twos,
,3333 ,threes,
-longstring,A Long String Variable,,2
+longstring,
Label:
A Long String Variable,,2
,Format: A12,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Display Width: 12,,
,Format: A12,,
,Measure: Nominal,,
,Display Alignment: Left,,
,Display Width: 12,,
-numeric,A Numeric Variable,,3
+numeric,
Label:
A Numeric Variable,,3
,Format: F10.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: F10.0,,
,Measure: Scale,,
,Display Alignment: Right,,
@@
-540,17
+540,17
@@
numeric,A Numeric Variable,,3
,colour[3],violet,
,nationality,foreign,
,size,large,
,colour[3],violet,
,nationality,foreign,
,size,large,
-date,A Date Variable,,4
+date,
Label:
A Date Variable,,4
,Format: DATE11,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: DATE11,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-dollar,A Dollar Variable,,5
+dollar,
Label:
A Dollar Variable,,5
,Format: DOLLAR11.2,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Format: DOLLAR11.2,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-datetime,A Datetime Variable,,6
+datetime,
Label:
A Datetime Variable,,6
,Format: DATETIME17.0,,
,Measure: Scale,,
,Display Alignment: Right,,
,Format: DATETIME17.0,,
,Measure: Scale,,
,Display Alignment: Right,,