Lines 239-244
Link Here
|
239 |
return i; |
239 |
return i; |
240 |
} |
240 |
} |
241 |
|
241 |
|
|
|
242 |
static void line_buffer() { |
243 |
#ifndef WIN32 |
244 |
// set up stdin and stdout to be line buffered |
245 |
assert(setvbuf(stdin, 0, _IOLBF, 0) == 0); |
246 |
assert(setvbuf(stdout, 0, _IOLBF, 0) == 0); |
247 |
#endif |
248 |
} |
249 |
|
242 |
Conv dconv; |
250 |
Conv dconv; |
243 |
Conv uiconv; |
251 |
Conv uiconv; |
244 |
|
252 |
|
Lines 686-696
Link Here
|
686 |
|
694 |
|
687 |
void pipe() |
695 |
void pipe() |
688 |
{ |
696 |
{ |
689 |
#ifndef WIN32 |
697 |
line_buffer(); |
690 |
// set up stdin and stdout to be line buffered |
|
|
691 |
assert(setvbuf(stdin, 0, _IOLBF, 0) == 0); |
692 |
assert(setvbuf(stdout, 0, _IOLBF, 0) == 0); |
693 |
#endif |
694 |
|
698 |
|
695 |
bool terse_mode = true; |
699 |
bool terse_mode = true; |
696 |
bool do_time = options->retrieve_bool("time"); |
700 |
bool do_time = options->retrieve_bool("time"); |
Lines 1651-1656
Link Here
|
1651 |
Conv oconv(setup_conv(lang, options)); |
1655 |
Conv oconv(setup_conv(lang, options)); |
1652 |
String word; |
1656 |
String word; |
1653 |
String sl; |
1657 |
String sl; |
|
|
1658 |
line_buffer(); |
1654 |
while (CIN.getline(word)) { |
1659 |
while (CIN.getline(word)) { |
1655 |
const char * w = iconv(word); |
1660 |
const char * w = iconv(word); |
1656 |
lang->LangImpl::to_soundslike(sl, w); |
1661 |
lang->LangImpl::to_soundslike(sl, w); |
Lines 1675-1680
Link Here
|
1675 |
Conv oconv(setup_conv(lang, options)); |
1680 |
Conv oconv(setup_conv(lang, options)); |
1676 |
String word; |
1681 |
String word; |
1677 |
GuessInfo gi; |
1682 |
GuessInfo gi; |
|
|
1683 |
line_buffer(); |
1678 |
while (CIN.getline(word)) { |
1684 |
while (CIN.getline(word)) { |
1679 |
lang->munch(iconv(word), &gi); |
1685 |
lang->munch(iconv(word), &gi); |
1680 |
COUT << word; |
1686 |
COUT << word; |
Lines 1713-1718
Link Here
|
1713 |
String word, buf; |
1719 |
String word, buf; |
1714 |
ObjStack exp_buf; |
1720 |
ObjStack exp_buf; |
1715 |
WordAff * exp_list; |
1721 |
WordAff * exp_list; |
|
|
1722 |
line_buffer(); |
1716 |
while (CIN.getline(word)) { |
1723 |
while (CIN.getline(word)) { |
1717 |
buf = word; |
1724 |
buf = word; |
1718 |
char * w = iconv(buf.mstr(), buf.size()); |
1725 |
char * w = iconv(buf.mstr(), buf.size()); |
Lines 1799-1804
Link Here
|
1799 |
String word; |
1806 |
String word; |
1800 |
String base; |
1807 |
String base; |
1801 |
String affs; |
1808 |
String affs; |
|
|
1809 |
line_buffer(); |
1802 |
while (CIN.getline(word)) { |
1810 |
while (CIN.getline(word)) { |
1803 |
word = iconv(word); |
1811 |
word = iconv(word); |
1804 |
|
1812 |
|
Lines 1882-1888
Link Here
|
1882 |
typedef SML_WordEntry Value; |
1890 |
typedef SML_WordEntry Value; |
1883 |
typedef const char * Key; |
1891 |
typedef const char * Key; |
1884 |
static const bool is_multi = false; |
1892 |
static const bool is_multi = false; |
1885 |
hash<const char *> hash; |
1893 |
acommon::hash<const char *> hash; |
1886 |
bool equal(Key x, Key y) {return strcmp(x,y) == 0;} |
1894 |
bool equal(Key x, Key y) {return strcmp(x,y) == 0;} |
1887 |
Key key(const Value & v) {return v.word;} |
1895 |
Key key(const Value & v) {return v.word;} |
1888 |
}; |
1896 |
}; |
Lines 2033-2039
Link Here
|
2033 |
typedef CML_Entry Value; |
2041 |
typedef CML_Entry Value; |
2034 |
typedef const char * Key; |
2042 |
typedef const char * Key; |
2035 |
static const bool is_multi = true; |
2043 |
static const bool is_multi = true; |
2036 |
hash<const char *> hash; |
2044 |
acommon::hash<const char *> hash; |
2037 |
bool equal(Key x, Key y) {return strcmp(x,y) == 0;} |
2045 |
bool equal(Key x, Key y) {return strcmp(x,y) == 0;} |
2038 |
Key key(const Value & v) {return v.word;} |
2046 |
Key key(const Value & v) {return v.word;} |
2039 |
}; |
2047 |
}; |