Commit 9c6ceacf by simetk

added direct addition of barcode vectors to dense vectors, began experimentation with morphic RIVs

parent 49b28180
Showing with 1143 additions and 1934 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <math.h>
/* RIVSIZE macro defines the dimensionality off the RIVs we will use /* RIVSIZE macro defines the dimensionality off the RIVs we will use
* 25000 is the standard, but can be redefined specifically * 25000 is the standard, but can be redefined specifically
*/ */
...@@ -64,6 +65,7 @@ typedef struct{ ...@@ -64,6 +65,7 @@ typedef struct{
struct RIVData{ struct RIVData{
size_t RIVsize; size_t RIVsize;
int nonZeros; int nonZeros;
int I2SThreshold;
int *h_tempBlock; int *h_tempBlock;
int tempSize; int tempSize;
int thing; int thing;
...@@ -75,7 +77,6 @@ struct RIVData{ ...@@ -75,7 +77,6 @@ struct RIVData{
* it sets global variables that practically all functions will reference, * it sets global variables that practically all functions will reference,
* it checks that your base parameters are valid, and allocates memory for * it checks that your base parameters are valid, and allocates memory for
* the functions to use, so that we can move fast with rare allocations. * the functions to use, so that we can move fast with rare allocations.
* #TODO add signal redefinitions so that cache is saved even on crash
*/ */
void RIVInit(); void RIVInit();
...@@ -85,7 +86,7 @@ void RIVInit(); ...@@ -85,7 +86,7 @@ void RIVInit();
void RIVCleanup(); void RIVCleanup();
/*consolidateD2S takes a denseRIV value-set input, and returns a sparse RIV with /*consolidateD2S takes a denseRIV value-set input, and returns a sparse RIV with
* all 0s removed. it does nto automatically carry metadata, which must be assigned * all 0s removed. it does not automatically carry metadata, which must be assigned
* to a denseRIV after the fact. often denseRIVs are only temporary, and don't * to a denseRIV after the fact. often denseRIVs are only temporary, and don't
* need to carry metadata * need to carry metadata
*/ */
...@@ -94,7 +95,7 @@ sparseRIV consolidateD2S(int *denseInput); //#TODO fix int*/denseRIV confusion ...@@ -94,7 +95,7 @@ sparseRIV consolidateD2S(int *denseInput); //#TODO fix int*/denseRIV confusion
/* mapS2D expands a sparseRIV out to denseRIV values, filling array locations /* mapS2D expands a sparseRIV out to denseRIV values, filling array locations
* based on location-value pairs * based on location-value pairs
*/ */
int* mapS2D(int* destination, sparseRIV input); //#TODO fix int*/denseRIV confusion
/* makeSparseLocations must be called repeatedly in the processing of a /* makeSparseLocations must be called repeatedly in the processing of a
* file to produce a series of locations from the words of the file * file to produce a series of locations from the words of the file
...@@ -110,7 +111,7 @@ void makesparseLocations(unsigned char* word, int *seeds, size_t seedCount); ...@@ -110,7 +111,7 @@ void makesparseLocations(unsigned char* word, int *seeds, size_t seedCount);
*/ */
int fLexPush(denseRIV RIVout); int fLexPush(denseRIV RIVout);
denseRIV fLexPull(FILE* lexWord, denseRIV output); denseRIV fLexPull(FILE* lexWord);
/* creates a standard seed from the characters in a word, hopefully unique */ /* creates a standard seed from the characters in a word, hopefully unique */
int wordtoSeed(unsigned char* word); int wordtoSeed(unsigned char* word);
...@@ -121,29 +122,16 @@ int wordtoSeed(unsigned char* word); ...@@ -121,29 +122,16 @@ int wordtoSeed(unsigned char* word);
*/ */
int* mapI2D(int *locations, size_t seedCount); int* mapI2D(int *locations, size_t seedCount);
int* addI2D(int* destination, int* locations, size_t seedCount);
int cacheDump();
sparseRIV consolidateI2SIndirect(int *implicit, size_t valueCount);
sparseRIV consolidateI2SDirect(int *implicit, size_t valueCount);
int cacheDump();
int* addI2D(int* destination, int* locations, size_t seedCount);
denseRIV denseAllocate();
void signalSecure(int signum, siginfo_t *si, void* arg); void signalSecure(int signum, siginfo_t *si, void* arg);
/* begin definitions */ /* begin definitions */
int* mapS2D(int* destination, sparseRIV input){// #TODO fix destination parameter vs calloc of destination
/* make sure our destination is a 0 vector */
memset(destination, 0, RIVKey.RIVsize*sizeof(int));
int *locations_slider = input.locations;
int *values_slider = input.values;
int *locations_stop = locations_slider+input.count;
/* apply values at an index based on locations */
while(locations_slider<locations_stop){
destination[*locations_slider] = *values_slider;
locations_slider++;
values_slider++;
}
return destination;
}
int* addS2D(int* destination, sparseRIV input){// #TODO fix destination parameter vs calloc of destination int* addS2D(int* destination, sparseRIV input){// #TODO fix destination parameter vs calloc of destination
...@@ -160,6 +148,8 @@ int* addS2D(int* destination, sparseRIV input){// #TODO fix destination paramete ...@@ -160,6 +148,8 @@ int* addS2D(int* destination, sparseRIV input){// #TODO fix destination paramete
return destination; return destination;
} }
int* mapI2D(int *locations, size_t valueCount){// #TODO fix destination parameter vs calloc of destination int* mapI2D(int *locations, size_t valueCount){// #TODO fix destination parameter vs calloc of destination
int *destination = (int*)calloc(RIVKey.RIVsize,sizeof(int)); int *destination = (int*)calloc(RIVKey.RIVsize,sizeof(int));
int *locations_slider = locations; int *locations_slider = locations;
...@@ -193,12 +183,54 @@ int* addI2D(int* destination, int *locations, size_t valueCount){// #TODO fix de ...@@ -193,12 +183,54 @@ int* addI2D(int* destination, int *locations, size_t valueCount){// #TODO fix de
return destination; return destination;
} }
sparseRIV consolidateI2SIndirect(int *implicit, size_t valueCount){
int *denseTemp = mapI2D(implicit, valueCount);
sparseRIV sparseOut = consolidateD2S(denseTemp);
free(denseTemp);
return sparseOut;
}
sparseRIV consolidateI2SDirect(int *implicit, size_t valueCount){
sparseRIV sparseOut;
int *locationsTemp = RIVKey.h_tempBlock+RIVKey.RIVsize;
int *valuesTemp = RIVKey.h_tempBlock+2*RIVKey.RIVsize;
sparseOut.count = 0;
int add = 1;
int found;
for(int i=0; i<valueCount; i++){
found = 0;
for(int j=0; j<sparseOut.count; j++){
if(implicit[i] == locationsTemp[j]){
valuesTemp[i] += add;
add *= -1;
found = 1;
}
}
if(!found){
locationsTemp[sparseOut.count] = implicit[i];
valuesTemp[sparseOut.count] = add;
sparseOut.count++;
add*= -1;
}
}
sparseOut.locations = malloc(2*sparseOut.count*sizeof(int));
sparseOut.values = sparseOut.locations+sparseOut.count;
memcpy(sparseOut.locations, locationsTemp, 2*sparseOut.count*sizeof(int));
return sparseOut;
}
sparseRIV consolidateD2S(int *denseInput){ sparseRIV consolidateD2S(int *denseInput){
sparseRIV output; sparseRIV output;
output.count = 0; output.count = 0;
/* key/value pairs will be loaded to a worst-case sized temporary slot */ /* key/value pairs will be loaded to a worst-case sized temporary slot */
int* locations = RIVKey.h_tempBlock; int* locations = RIVKey.h_tempBlock+RIVKey.RIVsize;
int* values = RIVKey.h_tempBlock+RIVKey.RIVsize; int* values = locations+RIVKey.RIVsize;
int* locations_slider = locations; int* locations_slider = locations;
int* values_slider = values; int* values_slider = values;
for(int i=0; i<RIVKey.RIVsize; i++){ for(int i=0; i<RIVKey.RIVsize; i++){
...@@ -236,7 +268,7 @@ sparseRIV consolidateD2S(int *denseInput){ ...@@ -236,7 +268,7 @@ sparseRIV consolidateD2S(int *denseInput){
void RIVInit(){ void RIVInit(){
RIVKey.RIVsize = RIVSIZE; //#TODO decide about macros vs global variables RIVKey.RIVsize = RIVSIZE; //#TODO decide about macros vs global variables
RIVKey.nonZeros = NONZEROS; RIVKey.nonZeros = NONZEROS;
RIVKey.I2SThreshold = sqrt(RIVSIZE);
if(RIVKey.nonZeros%2){ if(RIVKey.nonZeros%2){
printf("your NONZEROS value must be an even number"); printf("your NONZEROS value must be an even number");
RIVKey.nonZeros++; RIVKey.nonZeros++;
...@@ -248,9 +280,9 @@ void RIVInit(){ ...@@ -248,9 +280,9 @@ void RIVInit(){
struct sigaction action; struct sigaction action;
action.sa_sigaction = signalSecure; action.sa_sigaction = signalSecure;
action.sa_flags = SA_SIGINFO; action.sa_flags = SA_SIGINFO;
for(int i=1; i<27; i++){ //for(int i=1; i<27; i++){
sigaction(i,&action,NULL); sigaction(11,&action,NULL);
} //}
RIVKey.h_tempBlock = (int*)malloc(3*RIVKey.RIVsize*sizeof(int)); RIVKey.h_tempBlock = (int*)malloc(3*RIVKey.RIVsize*sizeof(int));
RIVKey.tempSize = 3*RIVKey.RIVsize; RIVKey.tempSize = 3*RIVKey.RIVsize;
...@@ -286,11 +318,11 @@ int wordtoSeed(unsigned char* word){ ...@@ -286,11 +318,11 @@ int wordtoSeed(unsigned char* word){
void makeSparseLocations(unsigned char* word, int *locations, size_t count){ void makeSparseLocations(unsigned char* word, int *locations, size_t count){
locations+=count; locations+=count;
srand(wordtoSeed(word)); srand(wordtoSeed(word));
for(int i=0; i<RIVKey.nonZeros; i++){ int *locations_stop = locations+RIVKey.nonZeros;
/* unrolled for speed, gauranteed to be an even number of steps */ while(locations<locations_stop){
/* unrolled for speed, guaranteed to be an even number of steps */
*locations = rand()%RIVKey.RIVsize; *locations = rand()%RIVKey.RIVsize;
locations++; locations++;
i++;
*locations = rand()%RIVKey.RIVsize; *locations = rand()%RIVKey.RIVsize;
locations++; locations++;
} }
...@@ -319,17 +351,19 @@ int fLexPush(denseRIV RIVout){ ...@@ -319,17 +351,19 @@ int fLexPush(denseRIV RIVout){
return 0; return 0;
} }
denseRIV fLexPull(FILE* lexWord, denseRIV output){ denseRIV fLexPull(FILE* lexWord){
denseRIV output;
output.values = malloc( (RIVKey.RIVsize+1) *sizeof(int));
output.frequency = output.values+RIVKey.RIVsize;
int diagnostic = 0; int diagnostic = 0;
diagnostic += fread(output.frequency, 1, sizeof(int), lexWord); diagnostic += fread(output.frequency, 1, sizeof(int), lexWord);
diagnostic += fread(&(output.magnitude), 1, sizeof(int), lexWord); diagnostic += fread(&(output.magnitude), 1, sizeof(int), lexWord);
diagnostic += fread(output.values, RIVKey.RIVsize, sizeof(int), lexWord); diagnostic += fread(output.values, RIVKey.RIVsize, sizeof(int), lexWord);
fclose(lexWord);
if(diagnostic != (RIVKey.RIVsize+2)){ if(diagnostic != (RIVKey.RIVsize+2)){
output.magnitude = -1; output.magnitude = -1;
} }
output.cached = 0;
return output; return output;
} }
...@@ -350,9 +384,22 @@ int cacheDump(){ ...@@ -350,9 +384,22 @@ int cacheDump(){
denseRIV* cache_stop = RIVKey.RIVCache+RIVKey.cacheSize; denseRIV* cache_stop = RIVKey.RIVCache+RIVKey.cacheSize;
while(cache_slider<cache_stop){ while(cache_slider<cache_stop){
if((*cache_slider).cached){ if((*cache_slider).cached){
fLexPush(*cache_slider); flag += fLexPush(*cache_slider);
} }
cache_slider++; cache_slider++;
} }
return flag; return flag;
} }
denseRIV denseAllocate(){
/* allocates a 0 vector */
denseRIV output;
output.values = calloc(RIVKey.RIVsize+1, sizeof(int));
/* for compact memory use, frequency is placed immediately after values */
output.frequency = output.values+RIVKey.RIVsize;
output.magnitude = 0;
output.cached = 0;
return output;
}
/*TODO add a simplified free function*/
No preview for this file type
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <math.h>
/* RIVSIZE macro defines the dimensionality off the RIVs we will use
* 25000 is the standard, but can be redefined specifically
*/
#ifndef RIVSIZE
#define RIVSIZE 25000
#endif
/* NONZeros macro defines the number of non-zero values that will be generated
* for any level one (barcode) RIV. 2 is simple and lightweight to begin
*/
#ifndef NONZEROS
#define NONZEROS 2
#endif
/* CACHESIZE macro defines the number of RIVs the system will cache.
* a larger cache means more memory consumption, but will also be significantly
* faster in aggregation and reading applications. doesn't affect systems
* that do not use lexpull/push
*/
#ifndef CACHESIZE
#define CACHESIZE 20
#endif
#define CACHED = 0x01
#define SPARSE = 0x02
#define AVAILABLE = 0x04
typedef struct{
char name[100];
int *values;
int *locations;
size_t count;
unsigned int* frequency;
float magnitude;
char flags;
}RIV;
/* the sparseRIV is a RIV form optimized for RIVs that will be mostly 0s
* as this is often an ideal case, it is adviseable as the default
* unless we are doing long term RIV aggregation.
* specifically, a sparseRIV contains a pair of arrays,
* containing locations and values, where pairs are found in like array
* indices.
*/
typedef RIV sparseRIV;
/* the denseRIV is a RIV form optimized for overwhelmingly non-0 vectors
* this is rarely the case, but its primary use is for performing vector
* math, as comparisons and arithmetic between vectors are ideally
* performed between sparse and dense (hetero-arithmetic)
*/
typedef RIV denseRIV;
/*RIVKey, holds globally important data that should not be changed partway through
* first function call in the program should always be:
* RIVinit();
* this will set these variables, check for incompatible choices, and open up
* memory blocks which the system will use in the background
*/
struct RIVData{
size_t RIVsize;
int nonZeros;
int I2SThreshold;
int *h_tempBlock;
int tempSize;
int thing;
denseRIV* RIVCache;
int cacheSize;
}static RIVKey;
/* RIVinit should be the first function called in any usage of this library
* it sets global variables that practically all functions will reference,
* it checks that your base parameters are valid, and allocates memory for
* the functions to use, so that we can move fast with rare allocations.
*/
void RIVInit();
/* RIVCleanup should always be called to close a RIV program. it frees
* blocks allocated by RIVinit, and dumps the cached data to appropriate lexicon files
*/
void RIVCleanup();
/*consolidateD2S takes a denseRIV value-set input, and returns a sparse RIV with
* all 0s removed. it does not automatically carry metadata, which must be assigned
* to a denseRIV after the fact. often denseRIVs are only temporary, and don't
* need to carry metadata
*/
sparseRIV consolidateD2S(int *denseInput); //#TODO fix int*/denseRIV confusion
/* mapS2D expands a sparseRIV out to denseRIV values, filling array locations
* based on location-value pairs
*/
/* makeSparseLocations must be called repeatedly in the processing of a
* file to produce a series of locations from the words of the file
* this produces an "implicit" RIV which can be used with the mapI2D function
* to create a denseRIV.
*/
void makesparseLocations(unsigned char* word, int *seeds, size_t seedCount);
/* fLexPush pushes the data contained in a denseRIV out to a lexicon file,
* saving it for long-term aggregation. function is called by "lexpush",
* which is what users should actually use. lexPush, unlike fLexPush,
* has cache logic under the hood for speed and harddrive optimization
*/
int fLexPush(denseRIV RIVout);
denseRIV fLexPull(FILE* lexWord);
/* creates a standard seed from the characters in a word, hopefully unique */
int wordtoSeed(unsigned char* word);
/* mapI2D maps an "implicit RIV" that is, an array of index values,
* arranged by chronological order of generation (as per makesparseLocations)
* it assigns, in the process of mapping, values according to ordering
*/
int* mapI2D(int *locations, size_t seedCount);
sparseRIV consolidateI2SIndirect(int *implicit, size_t valueCount);
sparseRIV consolidateI2SDirect(int *implicit, size_t valueCount);
int cacheDump();
int* addI2D(int* destination, int* locations, size_t seedCount);
denseRIV denseAllocate();
void signalSecure(int signum, siginfo_t *si, void* arg);
/* begin definitions */
int* addS2D(int* destination, sparseRIV input){// #TODO fix destination parameter vs calloc of destination
int *locations_slider = input.locations;
int *values_slider = input.values;
int *locations_stop = locations_slider+input.count;
/* apply values at an index based on locations */
while(locations_slider<locations_stop){
destination[*locations_slider] += *values_slider;
locations_slider++;
values_slider++;
}
return destination;
}
int* mapI2D(int *locations, size_t valueCount){// #TODO fix destination parameter vs calloc of destination
int *destination = (int*)calloc(RIVKey.RIVsize,sizeof(int));
int *locations_slider = locations;
int *locations_stop = locations_slider+valueCount;
/*apply values +1 or -1 at an index based on locations */
while(locations_slider<locations_stop){
destination[*locations_slider] +=1;
locations_slider++;
destination[*locations_slider] -= 1;
locations_slider++;
}
return destination;
}
int* addI2D(int* destination, int *locations, size_t valueCount){// #TODO fix destination parameter vs calloc of destination
int *locations_slider = locations;
int *locations_stop = locations_slider+valueCount;
/*apply values +1 or -1 at an index based on locations */
while(locations_slider<locations_stop){
destination[*locations_slider] +=1;
locations_slider++;
destination[*locations_slider] -= 1;
locations_slider++;
}
return destination;
}
sparseRIV consolidateI2SIndirect(int *implicit, size_t valueCount){
int *denseTemp = mapI2D(implicit, valueCount);
sparseRIV sparseOut = consolidateD2S(denseTemp);
free(denseTemp);
return sparseOut;
}
sparseRIV consolidateI2SDirect(int *implicit, size_t valueCount){
sparseRIV sparseOut;
int *locationsTemp = RIVKey.h_tempBlock+RIVKey.RIVsize;
int *valuesTemp = RIVKey.h_tempBlock+2*RIVKey.RIVsize;
sparseOut.count = 0;
int add = 1;
int found;
for(int i=0; i<valueCount; i++){
found = 0;
for(int j=0; j<sparseOut.count; j++){
if(implicit[i] == locationsTemp[j]){
valuesTemp[i] += add;
add *= -1;
found = 1;
}
}
if(!found){
locationsTemp[sparseOut.count] = implicit[i];
valuesTemp[sparseOut.count] = add;
sparseOut.count++;
add*= -1;
}
}
sparseOut.locations = malloc(2*sparseOut.count*sizeof(int));
sparseOut.values = sparseOut.locations+sparseOut.count;
memcpy(sparseOut.locations, locationsTemp, 2*sparseOut.count*sizeof(int));
return sparseOut;
}
sparseRIV consolidateD2S(int *denseInput){
sparseRIV output;
output.count = 0;
/* key/value pairs will be loaded to a worst-case sized temporary slot */
int* locations = RIVKey.h_tempBlock+RIVKey.RIVsize;
int* values = locations+RIVKey.RIVsize;
int* locations_slider = locations;
int* values_slider = values;
for(int i=0; i<RIVKey.RIVsize; i++){
/* act only on non-zeros */
if(denseInput[i]){
/* assign index to locations */
*(locations_slider++) = i;
/* assign value to values */
*(values_slider++) = denseInput[i];
/* track size of forming sparseRIV */
output.count++;
}
}
/* a slot is opened for the locations/values pair */
output.locations = (int*) malloc(output.count*2*sizeof(int));
if(!output.locations){
printf("memory allocation failed"); //*TODO enable fail point knowledge
}
/* copy locations values into opened slot */
memcpy(output.locations, locations, output.count*sizeof(int));
output.values = output.locations + output.count;
/* copy values into opened slot */
memcpy(output.values, values, output.count*sizeof(int));
return output;
}
void RIVInit(){
RIVKey.RIVsize = RIVSIZE; //#TODO decide about macros vs global variables
RIVKey.nonZeros = NONZEROS;
RIVKey.I2SThreshold = sqrt(RIVSIZE);
if(RIVKey.nonZeros%2){
printf("your NONZEROS value must be an even number");
RIVKey.nonZeros++;
printf(", changed to %d", RIVKey.nonZeros);
}
/* open a slot at least large enough for worst case handling of
* sparse to dense conversion. may be enlarged by filetoL2 functions */
struct sigaction action;
action.sa_sigaction = signalSecure;
action.sa_flags = SA_SIGINFO;
//for(int i=1; i<27; i++){
sigaction(11,&action,NULL);
//}
RIVKey.h_tempBlock = (int*)malloc(3*RIVKey.RIVsize*sizeof(int));
RIVKey.tempSize = 3*RIVKey.RIVsize;
RIVKey.thing = 0;
RIVKey.cacheSize = CACHESIZE;
/* open a slot for a cache of dense RIVs, optimized for frequent accesses */
RIVKey.RIVCache = (denseRIV*)calloc(RIVKey.cacheSize,sizeof(denseRIV));
}
void RIVCleanup(){
if(cacheDump()){
puts("cache dump failed, some lexicon data was lost");
}
#if CACHESIZE > 0
free(RIVKey.RIVCache);
#endif
free(RIVKey.h_tempBlock);
}
int wordtoSeed(unsigned char* word){
int i=0;
int seed = 0;
while(*word){
/* left-shift 5 each time *should* make seeds unique to words */
seed += (*(word))<<(i*5);
word++;
i++;
}
return seed;
}
void makeSparseLocations(unsigned char* word, int *locations, size_t count){
locations+=count;
srand(wordtoSeed(word));
int *locations_stop = locations+RIVKey.nonZeros;
while(locations<locations_stop){
/* unrolled for speed, guaranteed to be an even number of steps */
*locations = rand()%RIVKey.RIVsize;
locations++;
*locations = rand()%RIVKey.RIVsize;
locations++;
}
return;
}
int fLexPush(denseRIV RIVout){
char pathString[200] = {0};
/* word data will be placed in a (new?) file under the lexicon directory
* in a file named after the word itself */
sprintf(pathString, "lexicon/%s", RIVout.name);
FILE *lexWord = fopen(pathString, "wb");
if(!lexWord){
printf("lexicon push has failed for word: %s\nconsider cleaning inputs", pathString);
return 1;
}
fwrite(RIVout.frequency, 1, 4, lexWord);
fwrite(&RIVout.magnitude, 1, 4, lexWord);
fwrite(RIVout.values, RIVKey.RIVsize, 4, lexWord);
fclose(lexWord);
free(RIVout.values);
return 0;
}
denseRIV fLexPull(FILE* lexWord){
denseRIV output;
output.values = malloc( (RIVKey.RIVsize+1) *sizeof(int));
output.frequency = output.values+RIVKey.RIVsize;
int diagnostic = 0;
diagnostic += fread(output.frequency, 1, sizeof(int), lexWord);
diagnostic += fread(&(output.magnitude), 1, sizeof(int), lexWord);
diagnostic += fread(output.values, RIVKey.RIVsize, sizeof(int), lexWord);
if(diagnostic != (RIVKey.RIVsize+2)){
output.magnitude = -1;
}
output.flags = 0;
return output;
}
void signalSecure(int signum, siginfo_t *si, void* arg){
if(cacheDump()){
puts("cache dump failed, some lexicon data lost");
}else{
puts("cache dumped successfully");
}
signal(signum, SIG_DFL);
kill(getpid(), signum);
}
int cacheDump(){
int flag = 0;
denseRIV* cache_slider = RIVKey.RIVCache;
denseRIV* cache_stop = RIVKey.RIVCache+RIVKey.cacheSize;
while(cache_slider<cache_stop){
if((*cache_slider).cached){
flag += fLexPush(*cache_slider);
}
cache_slider++;
}
return flag;
}
denseRIV denseAllocate(){
/* allocates a 0 vector */
denseRIV output;
output.values = calloc(RIVKey.RIVsize+1, sizeof(int));
/* for compact memory use, frequency is placed immediately after values */
output.frequency = output.values+RIVKey.RIVsize;
output.magnitude = 0;
output.cached = 0;
return output;
}
/*TODO add a simplified free function*/
/*isWordClean filters words that contain non-letter characters, and
* upperCase letters, allowing only the '_' symbol through
*/
int isWordClean(char* word);
/* used by wordClean */
int isLetter(char c);
int isLetter(char c){
if((c>96 && c<123)||(c == 32) || (c == '_')) return 1;
else return 0;
}
int isWordClean(char* word){
char *letter = word;
char *word_stop = word+99;
while(letter<word_stop){
if(!(*letter)) break;
if(!(isLetter(*letter))){
return 0;
}
letter++;
}
return 1;
}
No preview for this file type
No preview for this file type
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#define RIVSIZE 5000 #define RIVSIZE 5000
#define CACHESIZE 0 #define CACHESIZE 0
#define THRESHOLD 0.70 #define NONZEROS 2
#define THRESHOLD 0.7
#define COSINEACTION do {\ #define COSINEACTION do {\
if(cosine > THRESHOLD){ \ if(cosine > THRESHOLD){ \
printf("%s\t%s\n%f\n", baseRIV.name, (*multipliers).name, cosine);\ printf("%s\t%s\n%f\n", baseRIV.name, (*multipliers).name, cosine);\
...@@ -33,13 +34,48 @@ int main(int argc, char *argv[]){ ...@@ -33,13 +34,48 @@ int main(int argc, char *argv[]){
directoryToL2s(rootString, &fileRIVs, &fileCount); directoryToL2s(rootString, &fileRIVs, &fileCount);
printf("fileCount: %d\n", fileCount); printf("fileCount: %d\n", fileCount);
getMagnitudes(fileRIVs, fileCount);
sparseRIV* fileRIVs_slider = fileRIVs;
sparseRIV* fileRIVs_stop = fileRIVs+fileCount;
while(fileRIVs_slider <fileRIVs_stop){
(*fileRIVs_slider).magnitude = getMagnitudeSparse(*fileRIVs_slider);
fileRIVs_slider++;
}
clock_t beginnsquared = clock(); clock_t beginnsquared = clock();
for(int i=1; i<fileCount; i++){ float cosine;
if(fileRIVs[i].boolean){ float minmag;
cosineCompare(fileRIVs[i], fileRIVs, i); float maxmag;
denseRIV baseDense;
baseDense.values = malloc(RIVKey.RIVsize*sizeof(int));
fileRIVs_slider = fileRIVs;
sparseRIV* comparators_slider;
while(fileRIVs_slider<fileRIVs_stop){
comparators_slider = fileRIVs;
memset(baseDense.values, 0, RIVKey.RIVsize*sizeof(int));
baseDense.values = addS2D(baseDense.values, *fileRIVs_slider);
baseDense.magnitude = (*fileRIVs_slider).magnitude;
minmag = baseDense.magnitude*.85;
maxmag = baseDense.magnitude*1.15;
while(comparators_slider < fileRIVs_slider){
if((*comparators_slider).magnitude < maxmag && (*comparators_slider).magnitude > minmag && (*comparators_slider).boolean){
cosine = cosCompare(baseDense, *comparators_slider);
if(cosine>THRESHOLD){
printf("%s\t%s\n%f\n", (*fileRIVs_slider).name , (*comparators_slider).name, cosine);
(*comparators_slider).boolean = 0;
RIVKey.thing++;
}
} }
comparators_slider++;
//cosineCompare(fileRIVs[i], fileRIVs, i);
}
fileRIVs_slider++;
} }
clock_t endnsquared = clock(); clock_t endnsquared = clock();
...@@ -85,7 +121,7 @@ void directoryToL2s(char *rootString, sparseRIV** fileRIVs, int *fileCount){ ...@@ -85,7 +121,7 @@ void directoryToL2s(char *rootString, sparseRIV** fileRIVs, int *fileCount){
}else{ }else{
(*fileRIVs) = (sparseRIV*)realloc((*fileRIVs), ((*fileCount)+1)*sizeof(sparseRIV)); (*fileRIVs) = (sparseRIV*)realloc((*fileRIVs), ((*fileCount)+1)*sizeof(sparseRIV));
(*fileRIVs)[(*fileCount)] = fileToL2Clean(input); (*fileRIVs)[(*fileCount)] = fileToL2(input);
strcpy((*fileRIVs)[(*fileCount)].name, pathString); strcpy((*fileRIVs)[(*fileCount)].name, pathString);
fclose(input); fclose(input);
......
No preview for this file type
No preview for this file type
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#define CACHESIZE 1000 #define CACHESIZE 10000
#include "RIVtoolsCPUlinux.h" #include "RIVtoolsCPUlinux.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
......
File deleted
...@@ -3,27 +3,16 @@ ...@@ -3,27 +3,16 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "RIVLower.h" #include "RIVLower.h"
#include "RIVaccessories.h"
#ifndef COSINEACTION /* lexPush writes a denseRIV to a file for permanent storage */
#define COSINEACTION
#endif
float* cosineCompareUnbound(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount);
/*lexPush writes a denseRIV to a file of the same name, under the directory "lexicon"
* it is up to the programmer to ensure that the name of the RIV is a valid filename
* although it will of course attempt to create the file if it does not exist
*/
int lexPush(denseRIV RIVout); int lexPush(denseRIV RIVout);
/* lexPull reads an existing lexicon entry (under directory "lexicon") /* lexPull reads an existing lexicon entry (under directory "lexicon")
* and creates a denseRIV with those attributes. * and creates a denseRIV with those attributes.
* if the file does not exist, it creates a 0 vector with the name of word * if the file does not exist, it creates a 0 vector with the name of word
*/ */
denseRIV lexPull(char* word); denseRIV lexPull(char* word);
/*isWordClean filters words that contain non-letter characters, and
* upperCase letters, allowing only the '_' symbol through
*/
int isWordClean(char* word);
int isLetter(char c);
/* fileToL2 takes an input file, reads words (delimiting on " " and "\n") /* fileToL2 takes an input file, reads words (delimiting on " " and "\n")
* and returns a sparse RIV which is the vector sum of the base RIVs of each * and returns a sparse RIV which is the vector sum of the base RIVs of each
* word contained * word contained
...@@ -35,18 +24,56 @@ sparseRIV fileToL2(FILE *input); ...@@ -35,18 +24,56 @@ sparseRIV fileToL2(FILE *input);
*/ */
sparseRIV fileToL2Clean(FILE *data); sparseRIV fileToL2Clean(FILE *data);
/* cosine determines the "similarity" between two RIVs. */ sparseRIV fileToL2direct(FILE *data);
float* cosineCompare(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount); /*cosine determines the "similarity" between two RIVs. */
float cosCompare(denseRIV baseRIV, sparseRIV comparator);
/* magnitudes will be used later in cosine comparison */
void getMagnitudes(sparseRIV *inputs, size_t RIVCount);
sparseRIV text2L2(unsigned char *text);//unused
unsigned char *sscanAdvance(unsigned char **string, unsigned char *word);//unused except in text2l2
sparseRIV wordtoL2(char* word); sparseRIV wordtoL2(char* word);
sparseRIV consolidateI2S(int *implicit, size_t valueCount);
sparseRIV text2L2(char *text);
sparseRIV text2L2(char *text){
unsigned int blockSize;
char word[100] = {0};
/* locations (implicit RIV) are temp stored in temp block, and moved
* to permanent home in consolidation */
int *locations = RIVKey.h_tempBlock;
int locationCount = 0;
int displacement;
while(sscanf(text, "%99s%n", word, &displacement)){
text += displacement+1;
if(!displacement){
break;
}
if(!(*word)){
break;
}
blockSize = locationCount+RIVKey.nonZeros;
/* if this word would overflow the locations block, grow it */
if(blockSize>RIVKey.tempSize){
RIVKey.h_tempBlock = (int*) realloc(RIVKey.h_tempBlock, blockSize*sizeof(int));
locations = RIVKey.h_tempBlock;
RIVKey.tempSize+=RIVKey.nonZeros;
}
/* add word's L1 RIV to the accumulating implicit RIV */
makeSparseLocations((unsigned char*)word, locations, locationCount);
locationCount+= RIVKey.nonZeros;
sparseRIV fileToL2(FILE *data){ }
sparseRIV output = consolidateI2S(locations, locationCount);
/* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1;
return output;
}
sparseRIV fileToL2(FILE *data){
unsigned int blockSize; unsigned int blockSize;
unsigned char word[100] = {0}; unsigned char word[100] = {0};
...@@ -78,16 +105,13 @@ sparseRIV wordtoL2(char* word); ...@@ -78,16 +105,13 @@ sparseRIV wordtoL2(char* word);
locationCount+= RIVKey.nonZeros; locationCount+= RIVKey.nonZeros;
} }
int *L2dense = calloc(RIVKey.RIVsize, sizeof(int));
/* in the next two steps, an implicit RIV is converted to a sparseRIV */ sparseRIV output = consolidateI2S(locations, locationCount);
L2dense = addI2D(L2dense, locations, locationCount);
sparseRIV output = consolidateD2S(L2dense);
free(L2dense);
/* frequency records the number of words in this file */ /* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros; output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1; output.boolean = 1;
return output; return output;
} }
...@@ -110,9 +134,9 @@ sparseRIV fileToL2Clean(FILE *data){ ...@@ -110,9 +134,9 @@ sparseRIV fileToL2Clean(FILE *data){
break; break;
} }
/* if the word is not clean, skip it */ /* if the word is not clean, skip it */
/*if(!isWordClean((char*)word)){ if(!isWordClean((char*)word)){
continue; continue;
}*/ }
blockSize = locationCount+RIVKey.nonZeros; blockSize = locationCount+RIVKey.nonZeros;
if(blockSize>RIVKey.tempSize){ if(blockSize>RIVKey.tempSize){
RIVKey.h_tempBlock = (int*)realloc(RIVKey.h_tempBlock, blockSize*sizeof(int)); RIVKey.h_tempBlock = (int*)realloc(RIVKey.h_tempBlock, blockSize*sizeof(int));
...@@ -124,201 +148,67 @@ sparseRIV fileToL2Clean(FILE *data){ ...@@ -124,201 +148,67 @@ sparseRIV fileToL2Clean(FILE *data){
locationCount+= RIVKey.nonZeros; locationCount+= RIVKey.nonZeros;
} }
int *L2dense = calloc(RIVKey.RIVsize, sizeof(int));
/* in the next two steps, an implicit RIV is converted to a sparseRIV */ sparseRIV output = consolidateI2S(locations, locationCount);
L2dense = addI2D(L2dense, locations, locationCount);
sparseRIV output = consolidateD2S(L2dense);
free(L2dense);
/* frequency records the number of words in this file */ /* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros; output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1; output.boolean = 1;
return output; return output;
} }
sparseRIV wordtoL2(char* word){
sparseRIV sparseOut;
makeSparseLocations((unsigned char*)word, RIVKey.h_tempBlock, 0);
int *denseSpot = calloc(RIVKey.RIVsize, sizeof(int));
addI2D(denseSpot, RIVKey.h_tempBlock, RIVKey.nonZeros);
sparseOut = consolidateD2S(denseSpot);
free(denseSpot);
sparseOut.frequency = 0;
return sparseOut;
}
float* cosineCompare(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount){
float *results = calloc(multiplierCount, sizeof(float));
float* results_slider = results;
int *baseDenseRIV = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVKey.RIVsize*sizeof(int));
addS2D(baseDenseRIV, baseRIV);
float cosine;
sparseRIV *multipliersStop = multipliers+multiplierCount;
/* if two vectors are too different in size, we can ignore the risk of similarity */
float minsize = baseRIV.magnitude * .85;
float maxsize = baseRIV.magnitude * 1.15;
int dot = 0;
int *values;
int *locations;
int *locations_Stop;
/* check the baseRIV against each multiplier */
while(multipliers<multipliersStop){
/* skip a pair if the multiplier has already been culled, or if
* the size difference is too great */
if(((*multipliers).boolean)
&& (((*multipliers).magnitude < maxsize)
&& ((*multipliers).magnitude > minsize))){
dot = 0;
values = (*multipliers).values;
locations = (*multipliers).locations;
locations_Stop = locations+(*multipliers).count;
while(locations<locations_Stop){ sparseRIV consolidateI2S(int *implicit, size_t valueCount){
/* we calculate the dot-product to derive the cosine */ if(valueCount>RIVKey.I2SThreshold){
dot += (*values)*(*(baseDenseRIV+(*locations))); return consolidateI2SIndirect(implicit, valueCount);
locations++; }else{
values++; return consolidateI2SDirect(implicit, valueCount);
}
/* magnitudes had better already be calculated at this point*/
cosine = dot/((baseRIV.magnitude)*((*multipliers).magnitude));
*results_slider = cosine;
results_slider++;
/* perform the action defined by the COSINEACTION macro */
COSINEACTION;
} }
multipliers++;
}
void aggregateWord2D(denseRIV destination, char* word){
//makeSparseLocations((unsigned char*)word, locationSlot, 0);
srand(wordtoSeed((unsigned char*)word));
for(int i=0; i<RIVKey.nonZeros; i++){
destination.values[(rand()%RIVKey.RIVsize)] +=1;
destination.values[(rand()%RIVKey.RIVsize)] -= 1;
} }
return results;
} }
/* unbound works without skipping on size */ float cosCompare(denseRIV baseRIV, sparseRIV comparator){
float* cosineCompareUnbound(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount){
float *results = calloc(multiplierCount, sizeof(float));
float* results_slider = results;
int *baseDenseRIV = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVKey.RIVsize*sizeof(int));
addS2D(baseDenseRIV, baseRIV);
float cosine;
sparseRIV *multipliersStop = multipliers+multiplierCount;
/* if two vectors are too different in size, we can ignore the risk of similarity */
int dot = 0;
int *values; int dot = 0;
int *locations;
int *locations_Stop;
/* check the baseRIV against each multiplier */
while(multipliers<multipliersStop){
dot = 0; int *values = comparator.values;
values = (*multipliers).values; int *locations = comparator.locations;
locations = (*multipliers).locations; int *locations_Stop = locations+comparator.count;
locations_Stop = locations+(*multipliers).count;
while(locations<locations_Stop){ while(locations<locations_Stop){
/* we calculate the dot-product to derive the cosine */ /* we calculate the dot-product to derive the cosine */
dot += (*values)*(*(baseDenseRIV+(*locations))); dot += (*values)*(*(baseRIV.values+(*locations)));
locations++; locations++;
values++; values++;
} }
/* magnitudes had better already be calculated at this point*/ float cosine = dot/(baseRIV.magnitude*comparator.magnitude);
cosine = dot/((baseRIV.magnitude)*((*multipliers).magnitude));
*results_slider = cosine;
results_slider++;
/* perform the action defined by the COSINEACTION macro */
COSINEACTION;
}
multipliers++;
return results; return cosine;
} }
float getMagnitudeSparse(sparseRIV input){
void getMagnitudes(sparseRIV *inputs, size_t RIVCount){
for(int i=0; i<RIVCount; i++){
unsigned long long int temp = 0; unsigned long long int temp = 0;
int *values = inputs[i].values; int *values = input.values;
int *values_stop = values+inputs[i].count; int *values_stop = values+input.count;
while(values<values_stop){ while(values<values_stop){
temp += (*values)*(*values); temp += (*values)*(*values);
values++; values++;
} }
float magnitude = sqrt(temp); float magnitude = sqrt(temp);
inputs[i].magnitude = magnitude; input.magnitude = magnitude;
} return magnitude;
}
unsigned char *sscanAdvance(unsigned char **string, unsigned char *word){
unsigned char *word_slider = word;
while(*(*string)){
if((*(*string) == ' ')||(*(*string) == '\n')) {
(*string)++;
break;
}
*word_slider = *(*string);
word_slider++;
(*string)++;
}
*word_slider = 0;
return word;
}
sparseRIV text2L2(unsigned char *text){
unsigned char word[2000] = {0};
int* locations = RIVKey.h_tempBlock;
unsigned char *text_slider = text;
int locationCount = 0;
while(*text_slider){
sscanAdvance(&text_slider, word);
if(word[0]){
makeSparseLocations(word, locations, locationCount);
locationCount+=RIVKey.nonZeros;
}
}
int *L2dense;
L2dense = mapI2D(locations, locationCount);
sparseRIV output = consolidateD2S(L2dense);
free(L2dense);
return output;
}
int isLetter(char c){
if((c>96 && c<123)||(c == 32) || (c == '_')) return 1;
else return 0;
} }
int isWordClean(char* word){
char *letter = word;
char *word_stop = word+99;
while(letter<word_stop){
if(!(*letter)) break;
if(!(isLetter(*letter))){
return 0;
}
letter++;
}
return 1;
}
denseRIV lexPull(char* word){ denseRIV lexPull(char* word){
#if CACHESIZE > 0 #if CACHESIZE > 0
...@@ -333,10 +223,7 @@ denseRIV lexPull(char* word){ ...@@ -333,10 +223,7 @@ denseRIV lexPull(char* word){
#endif /* CACHESIZE > 0 */ #endif /* CACHESIZE > 0 */
denseRIV output; denseRIV output;
output.values = (int*)calloc(RIVKey.RIVsize+1, sizeof(int));
/* for compact memory, frequency is placed immediately after the values field */
output.frequency = output.values+RIVKey.RIVsize;
char pathString[200]; char pathString[200];
...@@ -346,25 +233,13 @@ denseRIV lexPull(char* word){ ...@@ -346,25 +233,13 @@ denseRIV lexPull(char* word){
/* if this lexicon file already exists */ /* if this lexicon file already exists */
if(lexWord){ if(lexWord){
/* pull data from file */ /* pull data from file */
//output = fLexPull(lexWord, output); output = fLexPull(lexWord);
int diagnostic = 0;
//printf("%s \n", word);
diagnostic += fread(output.frequency, sizeof(int), 1, lexWord);
diagnostic += fread(&(output.magnitude), sizeof(float), 1, lexWord);
diagnostic += fread(output.values, sizeof(int), RIVKey.RIVsize, lexWord);
fclose(lexWord); fclose(lexWord);
if(diagnostic != (RIVKey.RIVsize+2)){
printf("something fuckked this way comes");
output.magnitude = -1;
}
}else{ }else{
/*if file does not exist, return a 0 vector */
/* if this lexicon file does not exist, return a 0 vector output = denseAllocate();
* calloc has already 0'd the values and frequencies */
output.magnitude = 0;
} }
output.cached = 0;
strcpy(output.name, word); strcpy(output.name, word);
return output; return output;
} }
...@@ -386,12 +261,6 @@ int lexPush(denseRIV RIVout){ ...@@ -386,12 +261,6 @@ int lexPush(denseRIV RIVout){
srand(wordtoSeed((unsigned char*)RIVout.name)); srand(wordtoSeed((unsigned char*)RIVout.name));
int hash = rand()%RIVKey.cacheSize; int hash = rand()%RIVKey.cacheSize;
//printf("%s\n", (*RIVout).name);
/* if this cache slot is empty (frequency is null pointer) */
/* hopefully this means that the RIV was previously cached,
* and pushed out from under itself when another RIV unseated it */
if(!RIVKey.RIVCache[hash].cached){ if(!RIVKey.RIVCache[hash].cached){
RIVKey.RIVCache[hash] = RIVout; RIVKey.RIVCache[hash] = RIVout;
RIVKey.RIVCache[hash].cached = 1; RIVKey.RIVCache[hash].cached = 1;
...@@ -416,4 +285,32 @@ int lexPush(denseRIV RIVout){ ...@@ -416,4 +285,32 @@ int lexPush(denseRIV RIVout){
#endif /* CACHESIZE == 0 */ #endif /* CACHESIZE == 0 */
} }
sparseRIV fileToL2direct(FILE *data){;
unsigned char word[100] = {0};
denseRIV denseTemp;
// a temporary dense RIV is stored in the tempBlock
denseTemp.values = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVSIZE*sizeof(int));
int count = 0;
while(fscanf(data, "%99s", word)){
count++;
if(feof(data)){
break;
}
if(!(*word)){
break;
}
// add word's L1 RIV to the accumulating implicit RIV
aggregateWord2D(denseTemp, (char*)word);
}
sparseRIV output = consolidateD2S(denseTemp.values);
// frequency records the number of words in this file
output.frequency = count;
output.boolean = 1;
return output;
}
No preview for this file type
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "RIVLower.h"
#include "RIVaccessories.h"
/* lexPush writes a denseRIV to a file for permanent storage */
int lexPush(denseRIV RIVout);
/* lexPull reads an existing lexicon entry (under directory "lexicon")
* and creates a denseRIV with those attributes.
* if the file does not exist, it creates a 0 vector with the name of word
*/
denseRIV lexPull(char* word);
/* fileToL2 takes an input file, reads words (delimiting on " " and "\n")
* and returns a sparse RIV which is the vector sum of the base RIVs of each
* word contained
*/
sparseRIV fileToL2(FILE *input);
/* fileToL2Clean operates the same as fileToL2 butkeeps only words
* containing lowercase letters and the '_' symbol
* this is important if you will be lexPush-ing those words later
*/
sparseRIV fileToL2Clean(FILE *data);
sparseRIV fileToL2direct(FILE *data);
/*cosine determines the "similarity" between two RIVs. */
float cosCompare(denseRIV baseRIV, sparseRIV comparator);
sparseRIV wordtoL2(char* word);
sparseRIV consolidateI2S(int *implicit, size_t valueCount);
sparseRIV text2L2(char *text);
sparseRIV text2L2(char *text){
unsigned int blockSize;
char word[100] = {0};
/* locations (implicit RIV) are temp stored in temp block, and moved
* to permanent home in consolidation */
int *locations = RIVKey.h_tempBlock;
int locationCount = 0;
int displacement;
while(sscanf(text, "%99s%n", word, &displacement)){
text += displacement+1;
if(!displacement){
break;
}
if(!(*word)){
break;
}
blockSize = locationCount+RIVKey.nonZeros;
/* if this word would overflow the locations block, grow it */
if(blockSize>RIVKey.tempSize){
RIVKey.h_tempBlock = (int*) realloc(RIVKey.h_tempBlock, blockSize*sizeof(int));
locations = RIVKey.h_tempBlock;
RIVKey.tempSize+=RIVKey.nonZeros;
}
/* add word's L1 RIV to the accumulating implicit RIV */
makeSparseLocations((unsigned char*)word, locations, locationCount);
locationCount+= RIVKey.nonZeros;
}
sparseRIV output = consolidateI2S(locations, locationCount);
/* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1;
return output;
}
sparseRIV fileToL2(FILE *data){
unsigned int blockSize;
unsigned char word[100] = {0};
/* locations (implicit RIV) are temp stored in temp block, and moved
* to permanent home in consolidation */
int *locations = RIVKey.h_tempBlock;
int locationCount = 0;
while(fscanf(data, "%99s", word)){
if(feof(data)){
break;
}
if(!(*word)){
break;
}
blockSize = locationCount+RIVKey.nonZeros;
/* if this word would overflow the locations block, grow it */
if(blockSize>RIVKey.tempSize){
RIVKey.h_tempBlock = (int*) realloc(RIVKey.h_tempBlock, blockSize*sizeof(int));
locations = RIVKey.h_tempBlock;
RIVKey.tempSize+=RIVKey.nonZeros;
}
/* add word's L1 RIV to the accumulating implicit RIV */
makeSparseLocations(word, locations, locationCount);
locationCount+= RIVKey.nonZeros;
}
sparseRIV output = consolidateI2S(locations, locationCount);
/* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1;
return output;
}
sparseRIV fileToL2Clean(FILE *data){
unsigned char word[100] = {0};
int *locations = RIVKey.h_tempBlock;
unsigned int blockSize;
int locationCount = 0;
while(fscanf(data, "%99s", word)){
if(feof(data)){
break;
}
if(!(*word)){
break;
}
/* if the word is not clean, skip it */
if(!isWordClean((char*)word)){
continue;
}
blockSize = locationCount+RIVKey.nonZeros;
if(blockSize>RIVKey.tempSize){
RIVKey.h_tempBlock = (int*)realloc(RIVKey.h_tempBlock, blockSize*sizeof(int));
locations = RIVKey.h_tempBlock;
RIVKey.tempSize+=RIVKey.nonZeros;
}
makeSparseLocations(word, locations, locationCount);
locationCount+= RIVKey.nonZeros;
}
sparseRIV output = consolidateI2S(locations, locationCount);
/* frequency records the number of words in this file */
output.frequency = locationCount/RIVKey.nonZeros;
output.boolean = 1;
return output;
}
sparseRIV consolidateI2S(int *implicit, size_t valueCount){
if(valueCount>RIVKey.I2SThreshold){
return consolidateI2SIndirect(implicit, valueCount);
}else{
return consolidateI2SDirect(implicit, valueCount);
}
}
void aggregateWord2D(denseRIV destination, char* word){
//makeSparseLocations((unsigned char*)word, locationSlot, 0);
srand(wordtoSeed((unsigned char*)word));
for(int i=0; i<RIVKey.nonZeros; i++){
destination.values[(rand()%RIVKey.RIVsize)] +=1;
destination.values[(rand()%RIVKey.RIVsize)] -= 1;
}
}
float cosCompare(denseRIV baseRIV, sparseRIV comparator){
int dot = 0;
int *values = comparator.values;
int *locations = comparator.locations;
int *locations_Stop = locations+comparator.count;
while(locations<locations_Stop){
/* we calculate the dot-product to derive the cosine */
dot += (*values)*(*(baseRIV.values+(*locations)));
locations++;
values++;
}
float cosine = dot/(baseRIV.magnitude*comparator.magnitude);
return cosine;
}
float getMagnitudeSparse(sparseRIV input){
unsigned long long int temp = 0;
int *values = input.values;
int *values_stop = values+input.count;
while(values<values_stop){
temp += (*values)*(*values);
values++;
}
float magnitude = sqrt(temp);
input.magnitude = magnitude;
return magnitude;
}
denseRIV lexPull(char* word){
#if CACHESIZE > 0
/* if there is a cache, first check if the word is cached */
srand(wordtoSeed((unsigned char*)word));
int hash = rand()%RIVKey.cacheSize;
if(!strcmp(word, RIVKey.RIVCache[hash].name)){
/* if word is cached, pull from cache and exit */
return RIVKey.RIVCache[hash];
}
#endif /* CACHESIZE > 0 */
denseRIV output;
char pathString[200];
sprintf(pathString, "lexicon/%s", word);
FILE *lexWord = fopen(pathString, "rb");
/* if this lexicon file already exists */
if(lexWord){
/* pull data from file */
output = fLexPull(lexWord);
fclose(lexWord);
}else{
/*if file does not exist, return a 0 vector */
output = denseAllocate();
}
strcpy(output.name, word);
return output;
}
int lexPush(denseRIV RIVout){
//printf("%s\n", (*RIVout).name);
#if CACHESIZE == 0
fLexPush(RIVout);
return 0;
#else /* CACHESIZE != 0 */
/* if our RIV was cached, there are two options (hopefully)
* either the RIV is still cached, and the data has been updated to the cache
* or the RIV was pushed out from under it, in which case it has already been pushed*/
if(RIVout.cached){
return 0;
}
srand(wordtoSeed((unsigned char*)RIVout.name));
int hash = rand()%RIVKey.cacheSize;
if(!RIVKey.RIVCache[hash].cached){
RIVKey.RIVCache[hash] = RIVout;
RIVKey.RIVCache[hash].cached = 1;
return 0;
/*if the current RIV is more frequent than the RIV holding it's slot */
}else if(*(RIVout.frequency) > *(RIVKey.RIVCache[hash].frequency) ){
//scanf("%f", &(*RIVout).magnitude);
//printf("%s replacing %s\n", (*RIVout).name, RIVKey.RIVCache[hash].name);
/* push the current cache entry to a file */
int diag = fLexPush(RIVKey.RIVCache[hash]);
/* replace the cache entry with the currrent RIV */
RIVKey.RIVCache[hash] = RIVout;
RIVKey.RIVCache[hash].cached = 1;
return diag;
}else{
/* push current RIV to file */
fLexPush(RIVout);
}
return 0;
#endif /* CACHESIZE == 0 */
}
sparseRIV fileToL2direct(FILE *data){;
unsigned char word[100] = {0};
denseRIV denseTemp;
// a temporary dense RIV is stored in the tempBlock
denseTemp.values = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVSIZE*sizeof(int));
int count = 0;
while(fscanf(data, "%99s", word)){
count++;
if(feof(data)){
break;
}
if(!(*word)){
break;
}
// add word's L1 RIV to the accumulating implicit RIV
aggregateWord2D(denseTemp, (char*)word);
}
sparseRIV output = consolidateD2S(denseTemp.values);
// frequency records the number of words in this file
output.frequency = count;
output.boolean = 1;
return output;
}
int* mapS2D(int* destination, sparseRIV input); //#TODO fix int*/denseRIV confusion
int* addI2D(int* destination, int* locations, size_t seedCount);
/* cosine determines the "similarity" between two RIVs. */
float* cosineCompare(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount);
/* magnitudes will be used later in cosine comparison */
void getMagnitudes(sparseRIV *inputs, size_t RIVCount);
unsigned char *sscanAdvance(unsigned char **string, unsigned char *word);//unused except in text2l2
sparseRIV text2L2(unsigned char *text);//unused
float* cosineCompareUnbound(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount);
/*lexPush writes a denseRIV to a file of the same name, under the directory "lexicon"
* it is up to the programmer to ensure that the name of the RIV is a valid filename
* although it will of course attempt to create the file if it does not exist
*/
int* mapS2D(denseRIV destination, sparseRIV input){// #TODO fix destination parameter vs calloc of destination
// make sure our destination is a 0 vector
memset(destination.values, 0, RIVKey.RIVsize*sizeof(int));
int *locations_slider = input.locations;
int *values_slider = input.values;
int *locations_stop = locations_slider+input.count;
// apply values at an index based on locations
while(locations_slider<locations_stop){
destination[*locations_slider] = *values_slider;
locations_slider++;
values_slider++;
}
strcpy(destination.name, input.name);
*(destination.frequency) = input.frequency;
destination.magnitude = input.magnitude;
return destination;
}
int* addI2D(int* destination, int *locations, size_t valueCount){// #TODO fix destination parameter vs calloc of destination
int *locations_slider = locations;
int *locations_stop = locations_slider+valueCount;
/*apply values +1 or -1 at an index based on locations */
while(locations_slider<locations_stop){
destination[*locations_slider] +=1;
locations_slider++;
destination[*locations_slider] -= 1;
locations_slider++;
}
return destination;
}
float* cosineCompare(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount){
float *results = calloc(multiplierCount, sizeof(float));
float* results_slider = results;
int *baseDenseRIV = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVKey.RIVsize*sizeof(int));
addS2D(baseDenseRIV, baseRIV);
float cosine;
sparseRIV *multipliersStop = multipliers+multiplierCount;
/* if two vectors are too different in size, we can ignore the risk of similarity */
float minsize = baseRIV.magnitude * .85;
float maxsize = baseRIV.magnitude * 1.15;
int dot = 0;
int *values;
int *locations;
int *locations_Stop;
/* check the baseRIV against each multiplier */
while(multipliers<multipliersStop){
/* skip a pair if the multiplier has already been culled, or if
* the size difference is too great */
if(((*multipliers).boolean)
&& (((*multipliers).magnitude < maxsize)
&& ((*multipliers).magnitude > minsize))){
dot = 0;
values = (*multipliers).values;
locations = (*multipliers).locations;
locations_Stop = locations+(*multipliers).count;
while(locations<locations_Stop){
/* we calculate the dot-product to derive the cosine */
dot += (*values)*(*(baseDenseRIV+(*locations)));
locations++;
values++;
}
/* magnitudes had better already be calculated at this point*/
cosine = dot/((baseRIV.magnitude)*((*multipliers).magnitude));
*results_slider = cosine;
results_slider++;
/* perform the action defined by the COSINEACTION macro */
COSINEACTION;
}
multipliers++;
}
return results;
}
float* cosineCompareUnbound(sparseRIV baseRIV, sparseRIV *multipliers, size_t multiplierCount){
float *results = calloc(multiplierCount, sizeof(float));
float* results_slider = results;
int *baseDenseRIV = RIVKey.h_tempBlock;
memset(RIVKey.h_tempBlock, 0, RIVKey.RIVsize*sizeof(int));
addS2D(baseDenseRIV, baseRIV);
float cosine;
sparseRIV *multipliersStop = multipliers+multiplierCount;
/* if two vectors are too different in size, we can ignore the risk of similarity */
int dot = 0;
int *values;
int *locations;
int *locations_Stop;
/* check the baseRIV against each multiplier */
while(multipliers<multipliersStop){
dot = 0;
values = (*multipliers).values;
locations = (*multipliers).locations;
locations_Stop = locations+(*multipliers).count;
while(locations<locations_Stop){
/* we calculate the dot-product to derive the cosine */
dot += (*values)*(*(baseDenseRIV+(*locations)));
locations++;
values++;
}
/* magnitudes had better already be calculated at this point*/
cosine = dot/((baseRIV.magnitude)*((*multipliers).magnitude));
*results_slider = cosine;
results_slider++;
/* perform the action defined by the COSINEACTION macro */
COSINEACTION;
}
multipliers++;
return results;
}
void getMagnitudes(sparseRIV *inputs, size_t RIVCount){
for(int i=0; i<RIVCount; i++){
unsigned long long int temp = 0;
int *values = inputs[i].values;
int *values_stop = values+inputs[i].count;
while(values<values_stop){
temp += (*values)*(*values);
values++;
}
float magnitude = sqrt(temp);
inputs[i].magnitude = magnitude;
}
}
File added
File added
project gutenberg scientific american supplement no
\ No newline at end of file
title scientific american supplement no february
\ No newline at end of file
rate feet work
\ No newline at end of file
cities herculaneum pompeii several smaller towns on slope
\ No newline at end of file
mountain destroyed lava buried under mass
\ No newline at end of file
pumice stones ashes second
\ No newline at end of file
contiguous mountains in iceland in two enormous lava
\ No newline at end of file
streams one miles wide over ft deep other
\ No newline at end of file
scarcely inferior flowed first miles other till
\ No newline at end of file
reached sea pouring flood white hot lava
\ No newline at end of file
ocean destroying in paths killing in water
\ No newline at end of file
ocean fish mainstay inhabitants who
\ No newline at end of file
reduced disaster directly indirectly less
\ No newline at end of file
former strength third
\ No newline at end of file
in devastated such an immense area in java but all
\ No newline at end of file
eruptions known besides as mere childs play terrible one
\ No newline at end of file
krakatoa in
\ No newline at end of file
reader will examine map east indies will find
\ No newline at end of file
represented in straits lie between sumatra
\ No newline at end of file
java little island krakatoa in maps make before will
\ No newline at end of file
hunt in vain name like bull run before then
\ No newline at end of file
unknown fame though navigators who passed through straits knew
\ No newline at end of file
vi educational competitive examinations
\ No newline at end of file
as beautiful tropical isle an extinct volcanic cone in
\ No newline at end of file
center in beginning however little well behaved
\ No newline at end of file
island showed symptoms wrath boded no good larger
\ No newline at end of file
islands in vicinity noted fine fruits
\ No newline at end of file
abounded famous picnic ground towns cities even
\ No newline at end of file
miles away subterranean rumblings mutterings
\ No newline at end of file
wrath became conspicuous people capital java
\ No newline at end of file
put steamboat requisition visited island in large
\ No newline at end of file
number time island constantly in slight tremor
\ No newline at end of file
subterranean roar like continue but distant mutterings
\ No newline at end of file
interesting details famous examinations
\ No newline at end of file
thunder but crisis reached august am
\ No newline at end of file
beautiful sunday morning water straits
\ No newline at end of file
like sea glass as clear as crystal john in
\ No newline at end of file
apocalyptic vision speaks beauty morning enhanced
\ No newline at end of file
extraordinary transparency tropical air distant mountain
\ No newline at end of file
ranges seem so near seem possible strike
\ No newline at end of file
stone cast hand only mysterious rumblings mutterings
\ No newline at end of file
pent up forces beneath island disturbed breathless calm
\ No newline at end of file
silence lay on calm before terrible
\ No newline at end of file
mightiest most awful on record burst forth sudden
\ No newline at end of file
consequences overworked competitors
\ No newline at end of file
night snatched away day eyes terrified beholders on
\ No newline at end of file
mainland but vivid play lightnings around ascending
\ No newline at end of file
column dust penetrated even deep obscurity distance
\ No newline at end of file
miles awful darkness stretched within circle diameter
\ No newline at end of file
miles while more less darkness reigned within circle
\ No newline at end of file
diameter three times as great within latter area dust
\ No newline at end of file
fall like snow sky breaking off limbs trees its weight
\ No newline at end of file
miles distant while in miles away scene
\ No newline at end of file
disaster fall depth several inches explosions
\ No newline at end of file
so loud as distinctly heard in miles away
\ No newline at end of file
sound like constant roar cannon in field
\ No newline at end of file
battle finally whole island blown pieces now came
\ No newline at end of file
most awful contest battle death between neptune
\ No newline at end of file
vulcan sea poured down chasm millions tons only
\ No newline at end of file
first converted vapor millions tons
\ No newline at end of file
seething white hot lava beneath over shores miles away waves
\ No newline at end of file
over ft high rolled such fury even
\ No newline at end of file
part bedrock swept away blocks stone tons
\ No newline at end of file
weight carry two miles inland on sumatra side
\ No newline at end of file
straits large vessel carry three miles inland wave
\ No newline at end of file
vii electrical speed engine
\ No newline at end of file
course growing less in intensity traveled across whole indian
\ No newline at end of file
ocean miles cape good hope around
\ No newline at end of file
atlantic waves in atmosphere traveled around globe three
\ No newline at end of file
times rate miles hour dust volcano
\ No newline at end of file
carry up atmosphere fully twenty miles finest
\ No newline at end of file
distribute through whole body air reader doubtless
\ No newline at end of file
remembers beautiful reddish purple glow sunrise sunset
\ No newline at end of file
fully six months after august glow caused
\ No newline at end of file
volcanic dust in atmosphere interfering passage
\ No newline at end of file
suns rays upper part solar spectrum more manifest
\ No newline at end of file
high speed compound engine running revolutions
\ No newline at end of file
sun rising setting other times day
\ No newline at end of file
periods suns rays have travel obliquely through
\ No newline at end of file
atmosphere consequently penetrating very deep layer
\ No newline at end of file
deprived all colors except red
\ No newline at end of file
loss life appalling last sight on earth
\ No newline at end of file
people awful eruption engulfed in ocean
\ No newline at end of file
covered heaps ashes few hours after eruption commenced
\ No newline at end of file
awful work done vast multitude had vanished off
\ No newline at end of file
face earth fact in neighborhood
\ No newline at end of file
minute dynamo electric lighting
\ No newline at end of file
mountain there sparse population accounts there not being
\ No newline at end of file
even far greater loss life
\ No newline at end of file
notwithstanding awfulness volcanic earthquake phenomena
\ No newline at end of file
there some silver lining dark clouds prove
\ No newline at end of file
earth yet living planet centuries must pass away before
\ No newline at end of file
will become like dead water air life
\ No newline at end of file
satellite prophecy indeed earth must eventually
\ No newline at end of file
become all its life forces its internal energies dissipated
\ No newline at end of file
f foster min press
\ No newline at end of file
illustrations
\ No newline at end of file
serpens
\ No newline at end of file
one five species himalayan plants recently
\ No newline at end of file
include in genus vaccinium new name ugly
\ No newline at end of file
enough make one wish vacciniums still
\ No newline at end of file
serpens most beautiful lot so far
\ No newline at end of file
as i know p only species in cultivation in
\ No newline at end of file
england former collected in himalayas about ten years ago
\ No newline at end of file
captain who forwarded grows flowers
\ No newline at end of file
freely under same treatment as suits cape heaths sir joseph
\ No newline at end of file
hooker says abundant on sikkim mountains
\ No newline at end of file
feet elevation usually grows on stout limbs
\ No newline at end of file
lofty trees in resembles many rhododendrons
\ No newline at end of file
viii treatment rattlesnake bite permanganate
\ No newline at end of file
region have suggested epiphytic force
\ No newline at end of file
circumstances not choice on ground will have no
\ No newline at end of file
chance other vegetation will strangle starve
\ No newline at end of file
out remove struggle existence
\ No newline at end of file
once show preference rich soil plenty all
\ No newline at end of file
have lower part stem often swelling out
\ No newline at end of file
prostrate trunk as thick as mans leg sometimes sending
\ No newline at end of file
out stout branching roots cling tightly round limbs
\ No newline at end of file
tree grows swollen stems quite succulent
\ No newline at end of file
serve as reservoirs moisture nourishment in wet
\ No newline at end of file
potassium based on nine successful
\ No newline at end of file
season push out new shoots grow rapidly wands three
\ No newline at end of file
four feet long clothed boxlike leave afterward
\ No newline at end of file
numerous pendulous flowers elegant in shape richly
\ No newline at end of file
colored five ribs running whole length
\ No newline at end of file
corolla color bright crimson deeper colored
\ No newline at end of file
veins as shown in illustration flowers almost
\ No newline at end of file
natural size remain fresh plant several weeks
\ No newline at end of file
beautiful appearance well grown specimen in flower may
\ No newline at end of file
seen accompanying sketch specimen
\ No newline at end of file
its best in july remained in bloom middle september
\ No newline at end of file
amos w barber use powerful disinfectant
\ No newline at end of file
illustration serpens flowers nearly natural size
\ No newline at end of file
p also grown as greenhouse plant have
\ No newline at end of file
in cultivation about twenty years have larger leave
\ No newline at end of file
more bushy habit p serpens while flowers produce in
\ No newline at end of file
fascicles on old wood as large as here figured
\ No newline at end of file
but differ in color being whitish marks
\ No newline at end of file
both species may propagated cuttings plants thrive in
\ No newline at end of file
proper treatment mode applying
\ No newline at end of file
sandy peat like plenty moisture all
\ No newline at end of file
watson in gardeners magazine
\ No newline at end of file
illustration serpens flowers deep crimson
\ No newline at end of file
perforation flowers
\ No newline at end of file
subject relations adaptations exist between
\ No newline at end of file
flowers insects do not appear excite as much popular
\ No newline at end of file
attention as many other branches natural science no more
\ No newline at end of file
interesting darwin hermann muller have chief
\ No newline at end of file
authors in give us present knowledge interest in study
\ No newline at end of file
sir john lubbock have helped popularize prof w
\ No newline at end of file
have carry on work in country
\ No newline at end of file
ix joseph
\ No newline at end of file
perforation as well as fertilization flowers have received
\ No newline at end of file
attention but there wide field further study who
\ No newline at end of file
have leisure pursue as requires much time patience as
\ No newline at end of file
well as closeness accuracy observation
\ No newline at end of file
accompanying figures drawings mr ce show few
\ No newline at end of file
characteristic perforations mutilations also represent two
\ No newline at end of file
principal kinds insects make
\ No newline at end of file
epochs probabilities present
\ No newline at end of file
any one interested in subject will find an excellent brief review
\ No newline at end of file
work already done fair bibliography list
\ No newline at end of file
perforated flowers in professor lh paper on
\ No newline at end of file
perforation flowers in transactions louis
\ No newline at end of file
academy science v
\ No newline at end of file
general beauty flowers usually not greatly marred
\ No newline at end of file
perforations except in few cases as spurs columbines
\ No newline at end of file
corollas trumpet creepers much torn frequently
\ No newline at end of file
happens
\ No newline at end of file
climatic within records man
\ No newline at end of file
great object perforations insects obtaining
\ No newline at end of file
concealed nectar in an easy way very naturally flowers
\ No newline at end of file
depend on insect agency fertilization rarely produce seed
\ No newline at end of file
punctured not also enter in normal way perforating
\ No newline at end of file
only practiced small number species insects many
\ No newline at end of file
but not all do so tongues too
\ No newline at end of file
short reach nectar entering flower some obtain nectar
\ No newline at end of file
same kind flower both in normal way
\ No newline at end of file
perforating
\ No newline at end of file
chief flowers in part continent
\ No newline at end of file
least appear some kinds humble bees bombus carpenter
\ No newline at end of file
bees xylocopa insects have developed an unerring instinct as
\ No newline at end of file
proper point perforate corollas outside in
\ No newline at end of file
order readily get nectar holes make humble bees
\ No newline at end of file
carpenter bees usually quite different easily
\ No newline at end of file
distinguish
\ No newline at end of file
humble bees have short stout blunt jaws ill adapted
\ No newline at end of file
author various
\ No newline at end of file
eruption graphic description catastrophe
\ No newline at end of file
cutting perforations make apparently always
\ No newline at end of file
irregular in shape have jagged edges have stated
\ No newline at end of file
humble bees often bore through tubes corollas
\ No newline at end of file
but in all cases observed me mandibles first
\ No newline at end of file
bring use in effecting an opening noise caused
\ No newline at end of file
tearing often audible distance several feet
\ No newline at end of file
true jaws carpenter bees not any more prominent
\ No newline at end of file
better adapted making perforations
\ No newline at end of file
humble bees but behind jaws there pair long
\ No newline at end of file
involving lives people
\ No newline at end of file
knifelike jointed organs seem
\ No newline at end of file
exclusively use on all ordinary occasions in making perforations
\ No newline at end of file
inner edges nearly straight bring
\ No newline at end of file
together form instrument
\ No newline at end of file
makes clean narrow longitudinal slit inserted in
\ No newline at end of file
flower shoved forward slits make often not
\ No newline at end of file
readily seen elasticity tissues some flowers
\ No newline at end of file
causes partially close again not in use instrument
\ No newline at end of file
can folded back so not conspicuous ordinary
\ No newline at end of file
observer usually see no difference between humble bees
\ No newline at end of file
carpenter bees but may readily distinguish little
\ No newline at end of file
close observation
\ No newline at end of file
illustration perforation flowers
\ No newline at end of file
xylocopa heads male female bombus head
\ No newline at end of file
dicentra showing punctures ribes ligustrum
\ No newline at end of file
lonicera caragana
\ No newline at end of file
andromeda japonica buddleia japonica
\ No newline at end of file
mertensia rhododendron corydalis
\ No newline at end of file
x military military engineer
\ No newline at end of file
no doubt in some recorded cases perforations carpenter
\ No newline at end of file
bees have mistake humble bees heads all northern
\ No newline at end of file
humble bees rather narrow retreating
\ No newline at end of file
sides more less dense tuft hair between
\ No newline at end of file
abdomen as well as thorax always quite densely covered
\ No newline at end of file
hair may black yellowish in bands either
\ No newline at end of file
color possibly one two exceptions only species i have
\ No newline at end of file
seen doing puncturing bombus cresson
\ No newline at end of file
col college lecture treating
\ No newline at end of file
carpenter bees xylocopa region have head
\ No newline at end of file
very broad square in front no noticeable hair between
\ No newline at end of file
heads male female differ strikingly in
\ No newline at end of file
male eyes lighter colored hardly half as far apart
\ No newline at end of file
as in female lower part face yellowish white
\ No newline at end of file
female have eyes smaller darker very far apart whole
\ No newline at end of file
face perfectly black abdomen broad shining
\ No newline at end of file
color very sparsely covered black hairs except on first
\ No newline at end of file
large segment nearest thorax on segment more dense
\ No newline at end of file
special problems in fortifications sieges more
\ No newline at end of file
same tawny color as on thorax but
\ No newline at end of file
particularly character head amateur observer
\ No newline at end of file
may soon learn distinguish between xylocopa
\ No newline at end of file
bombus as work flowers also interesting
\ No newline at end of file
know xylocopas not so inclined sting as humble
\ No newline at end of file
bees males course being stinging organs may
\ No newline at end of file
handled impunity
\ No newline at end of file
other insects honey bees have said perforate flowers
\ No newline at end of file
but authentic instances rare doing much damage even
\ No newline at end of file
pacific work surveys explorations
\ No newline at end of file
making holes i have only recorded single instance in
\ No newline at end of file
honey bee seen perforate fragile spurs
\ No newline at end of file
searching nectar quite commonly use perforations other
\ No newline at end of file
insects wasps other allied insects also perforate nectar
\ No newline at end of file
only observations being vespa puncturing cassandra an
\ No newline at end of file
andrena perforating spurs
\ No newline at end of file
biting holes close base on upper side
\ No newline at end of file
rhododendron flowers holes make some insects
\ No newline at end of file
often more less circular edges ravages
\ No newline at end of file
committed beetles other insects in devouring flowers
\ No newline at end of file
parts do not properly come under head perforations
\ No newline at end of file
question as cause handsome corollas trumpet
\ No newline at end of file
creeper being so often split torn have
\ No newline at end of file
accounted in various ways in published note on subject
\ No newline at end of file
humming birds ants have blamed humming birds being such
\ No newline at end of file
constant visitors flowers really seem as though
\ No newline at end of file
must authors mischief i have often watched
\ No newline at end of file
appeared as though pecking blossoms but
\ No newline at end of file
careful examinations both before after visits always
\ No newline at end of file
xi sulphide
\ No newline at end of file
failed show any trace injury finally on july i
\ No newline at end of file
rewarded seeing number baltimore orioles vigorously pecking
\ No newline at end of file
tearing open lot fresh blossoms observation
\ No newline at end of file
afterward repeated oriole shall do not surprising
\ No newline at end of file
considering its known habits in relation some other flowers
\ No newline at end of file
jack
\ No newline at end of file
mr jack adds list sixteen plants flowers have seen
\ No newline at end of file
punctured carpenter bee seventeen flowers
\ No newline at end of file
punctured humble bee name more thirty other flowers
\ No newline at end of file
probable new occurrence gold
\ No newline at end of file
have find perforated having seen identified
\ No newline at end of file
authors forest
\ No newline at end of file
electricity in horticulture
\ No newline at end of file
influence electricity vegetation have subject
\ No newline at end of file
numerous investigations some have make ascertain effects
\ No newline at end of file
electric current through soil ascertain
\ No newline at end of file
effect electric light growth through air
\ No newline at end of file
latter prof lh bailey cornell university
\ No newline at end of file
agricultural experiment station in bulletin no
\ No newline at end of file
horticultural department give an account experiments
\ No newline at end of file
electric light growth certain vegetables like endive
\ No newline at end of file
spinach radish certain flowers like heliotrope
\ No newline at end of file
xii natural living jerboa in zoological
\ No newline at end of file
petunia verbena primula results interesting
\ No newline at end of file
somewhat variable forcing house experiments
\ No newline at end of file
carry on ft divided two portions
\ No newline at end of file
partition in one plants received light sun
\ No newline at end of file
day in darkness night in other received
\ No newline at end of file
sunlight in addition had benefit an arc light whole
\ No newline at end of file
part night experiment lasted january april
\ No newline at end of file
two years six weeks time first year naked
\ No newline at end of file
light balance time light protected an
\ No newline at end of file
ordinary white globe not purpose here enter any
\ No newline at end of file
garden rare rodent south africa one seldom
\ No newline at end of file
great details but give general conclusions
\ No newline at end of file
effect naked light running all night hasten
\ No newline at end of file
maturity nearer plants being light greater being
\ No newline at end of file
acceleration lettuce spinach ran seed in
\ No newline at end of file
light house long before similar plants in dark an examination
\ No newline at end of file
spinach leave microscope showed same amount
\ No newline at end of file
starch in each but in electric light plants grains
\ No newline at end of file
larger had more distinct markings gave deeper color
\ No newline at end of file
iodine
\ No newline at end of file
seen alive in captivity illustrations
\ No newline at end of file
lettuce find nearer plants light
\ No newline at end of file
worse effect conversely furthest away best
\ No newline at end of file
developed cress endive gave same results in case
\ No newline at end of file
latter some plants shaded light an iron post
\ No newline at end of file
grew better larger exposed its direct
\ No newline at end of file
rays average weight eight plants in full light
\ No newline at end of file
grains as opposed an average six plants in shade
\ No newline at end of file
grains radishes strongly attracted light moved
\ No newline at end of file
night day straightened up but moved
\ No newline at end of file
again light night plants nearest lamp make
\ No newline at end of file
poor growth nearly dead end six weeks averaging
\ No newline at end of file
weight plant top tuber find
\ No newline at end of file
grown in dark heavier in every instance grown in
\ No newline at end of file
light percentage marketable tubers
\ No newline at end of file
plants as opposed in
\ No newline at end of file
dark chemical analyses showed plants in light more
\ No newline at end of file
mature in dark much smaller dwarf
\ No newline at end of file
peas showed same facts in full light being smaller
\ No newline at end of file
in dark former bloomed week earlier latter
\ No newline at end of file
xiii naval knot possibility
\ No newline at end of file
but production seed less being only about as
\ No newline at end of file
great
\ No newline at end of file
further experiments make excluding sun day
\ No newline at end of file
exposing plants diffused electric light only in all cases
\ No newline at end of file
radishes lettuce peas corn potatoes plants died in
\ No newline at end of file
about four weeks only little starch no chlorophyl find in
\ No newline at end of file
plants deprived sunlight only receiving electric light
\ No newline at end of file
thus experiments naked light showed conclusively
\ No newline at end of file
within range an ordinary forcing house naked arc light running
\ No newline at end of file
fast ships long prospects difficulties
\ No newline at end of file
continuously through night injurious some plants in no
\ No newline at end of file
case did prove profitable
\ No newline at end of file
experiments light inclosed in white globe running all
\ No newline at end of file
night different in results effect much less
\ No newline at end of file
marked lettuce decidedly better in light house radishes
\ No newline at end of file
thrifty but did not produce as much as in dark house third
\ No newline at end of file
series experiments naked light running part night
\ No newline at end of file
only also make radishes peas lettuce many flowers
\ No newline at end of file
experimented lettuce greatly benefited light
\ No newline at end of file
three weeks after transplanting feb told both
\ No newline at end of file
varieties in lighthouse fully cent in advance
\ No newline at end of file
in dark house in size color other characters
\ No newline at end of file
plants fully as good plants had received time
\ No newline at end of file
hours electric light just month later first heads
\ No newline at end of file
sold light house but six weeks later first
\ No newline at end of file
heads sold dark house in other word electric
\ No newline at end of file
light plants two weeks ahead gain had
\ No newline at end of file
purchased hours electric light worth current prices
\ No newline at end of file
street lighting about
\ No newline at end of file
xiv railroad steam street railway
\ No newline at end of file
experiment repeated same results in second
\ No newline at end of file
experiment plants receiving hours electric light
\ No newline at end of file
costing ready market ten days before plants in
\ No newline at end of file
dark house influence light color flowers
\ No newline at end of file
variable tulips colors lighted plants deeper
\ No newline at end of file
richer but faded after four five days
\ No newline at end of file
verbenas injured in every case being shorter growth
\ No newline at end of file
losing flowers sooner in dark house scarlet
\ No newline at end of file
dark red blue pink flowers within three feet light soon
\ No newline at end of file
noiseless motor build steel on trial in chicago illustration
\ No newline at end of file
turned grayish white chinese primulas seven feet light
\ No newline at end of file
unaffected but four feet away changed lilac colors
\ No newline at end of file
bleached pure white light struck fairly an
\ No newline at end of file
elaborate series tables effect light give in
\ No newline at end of file
paper author believes possible electric light may
\ No newline at end of file
use some day pecuniary advantage in floricultural establishments
\ No newline at end of file
experiments naturally open up many questions will
\ No newline at end of file
most importance practical man will such as relate
\ No newline at end of file
benefits derived use electric light
\ No newline at end of file
release date february
\ No newline at end of file
electricity have great effect vegetation can no longer
\ No newline at end of file
denied remains now ascertain use force
\ No newline at end of file
most economy best advantage its use early vegetables
\ No newline at end of file
will make earlier bright flowers make brighter will
\ No newline at end of file
question only short time before will come general use
\ No newline at end of file
student plant physiology there also many questions
\ No newline at end of file
interest but not intention enter prof
\ No newline at end of file
baileys general conclusions in part as follows there
\ No newline at end of file
few points clear electric light promotes assimilation
\ No newline at end of file
often hastens growth maturity capable producing
\ No newline at end of file
xv sanitary means purifying
\ No newline at end of file
natural flavors colors in fruits often intensifies colors
\ No newline at end of file
flowers sometimes increases production flowers
\ No newline at end of file
experiments show periods darkness not necessary
\ No newline at end of file
growth development plants there every reason therefore
\ No newline at end of file
suppose electric light can profitably use in growing
\ No newline at end of file
plants only necessary overcome difficulties
\ No newline at end of file
chief injurious influences plants near
\ No newline at end of file
light too rapid hastening maturity in some species in
\ No newline at end of file
short whole series practical adjustments conditions
\ No newline at end of file
individual circumstances thus far sure have learned more
\ No newline at end of file
filtering processes subsidence treatment
\ No newline at end of file
injurious effects beneficial ones but only
\ No newline at end of file
means acquiring definite facts concerning whole
\ No newline at end of file
influence electric light vegetation in some cases
\ No newline at end of file
notably in lettuce tests light have already find
\ No newline at end of file
useful adjunct forcing establishments highly probable
\ No newline at end of file
there certain times in life plant
\ No newline at end of file
electric light will prove particularly helpful many experiments
\ No newline at end of file
show injury follows its use critical time
\ No newline at end of file
losing its support seed beginning
\ No newline at end of file
shift other experiments show good results follow
\ No newline at end of file
water
\ No newline at end of file
its later use on whole i am inclined siemens
\ No newline at end of file
view there future
\ No newline at end of file
joseph p james
\ No newline at end of file
washington jan
\ No newline at end of file
electricity in agriculture clarence d warner
\ No newline at end of file
well known currents electricity exist in atmosphere
\ No newline at end of file
clouds charged discharged there constant change
\ No newline at end of file
electricity earth air air earth latter being
\ No newline at end of file
great reservoir all electricity hills mountain peaks trees
\ No newline at end of file
high chimneys spires in fact all points elevated above earths
\ No newline at end of file
surface assist greatly in charging discharging atmosphere
\ No newline at end of file
xvi caustic soda on
\ No newline at end of file
again two iron rods driven earth connected
\ No newline at end of file
copper wire an electrometer in circuit instrument
\ No newline at end of file
almost immediately affected showing currents electricity
\ No newline at end of file
running through ground now function
\ No newline at end of file
atmospheric ground electric currents many scientists agree
\ No newline at end of file
certain forms precipitation due electrical action but
\ No newline at end of file
observations have led me believe conclusively electricity
\ No newline at end of file
potent factor in economy nature have more do
\ No newline at end of file
growth development plants have hitherto known
\ No newline at end of file
davy succeeded in decomposition alkalies potash soda
\ No newline at end of file
experiments on action lye on wood various
\ No newline at end of file
means electric currents in laboratories water ternary
\ No newline at end of file
compounds rapidly decomposed battery may reasonably
\ No newline at end of file
suppose effected in laboratories artificial
\ No newline at end of file
means takes place in great laboratory nature on grander
\ No newline at end of file
more extended scale
\ No newline at end of file
plant food carry throughout plant means flow
\ No newline at end of file
sap currents circulate through all rootlets center as
\ No newline at end of file
in stalk carrying tiny burdens various elements
\ No newline at end of file
depositing in proper places phenomenon
\ No newline at end of file
pressures
\ No newline at end of file
circulation due electricity doubted most plants grow
\ No newline at end of file
more rapidly night in day may not following
\ No newline at end of file
reason
\ No newline at end of file
have already mentioned electric currents pass air earth
\ No newline at end of file
vice night plant generally covered dew
\ No newline at end of file
plant become good conductor consequently currents
\ No newline at end of file
electricity pass each through medium
\ No newline at end of file
passage convert soil elements plant food stimulate upward
\ No newline at end of file
currents gather up dissolved elements carry
\ No newline at end of file
proper places
\ No newline at end of file
time electricity became science much research have
\ No newline at end of file
make determine its effect any plant growth earlier
\ No newline at end of file
investigations gave in many cases contradictory results
\ No newline at end of file
due lack knowledge science on part one
\ No newline at end of file
performing experiments some defect in technical
\ No newline at end of file
applications not prepared say but do know
\ No newline at end of file
such men as other eminent physicists
\ No newline at end of file
affirmed electricity favored germination seeds
\ No newline at end of file
burn brick crude oil use petroleum in
\ No newline at end of file
accelerated growth plants while on other hand
\ No newline at end of file
other savants denied existence
\ No newline at end of file
electric influence heated controversies animated discussions
\ No newline at end of file
attending opposing theories stimulated more careful thorough
\ No newline at end of file
investigations establish beyond doubt electricity have
\ No newline at end of file
beneficial effect on vegetation sir davy humboldt wollaston
\ No newline at end of file
becquerel occupied theoretical side
\ No newline at end of file
question but not till after practical
\ No newline at end of file
undertaken suggested use gigantic electrostatic
\ No newline at end of file
machines but attempts fruitless methods most generally
\ No newline at end of file
brick advantages cleanliness cheapness
\ No newline at end of file
adopted in experiments consisted two metallic copper
\ No newline at end of file
one in soil connected wire
\ No newline at end of file
employed method in england in use same in
\ No newline at end of file
scotland in year in germany surrounded field
\ No newline at end of file
network wires experiments showed electricity
\ No newline at end of file
increased return root crops while grass perished near
\ No newline at end of file
electrodes plants developed use electricity
\ No newline at end of file
inferior grown under its influence came
\ No newline at end of file
conclusion seeds germinated more rapidly buckwheat gave
\ No newline at end of file
larger returns in all other cases electric current produce no
\ No newline at end of file
result professor fife in england in germany carry
\ No newline at end of file
on experiments same time but negative results
\ No newline at end of file
scientists advised complete abandonment applying electricity
\ No newline at end of file
agriculture after some years had elapsed began series
\ No newline at end of file
experiments in same direction employed battery two
\ No newline at end of file
wires placed in soil parallel each other between
\ No newline at end of file
wires planted peas grass barley in every case
\ No newline at end of file
crop showed an increase thirteen cent
\ No newline at end of file
compared ordinary methods cultivation
\ No newline at end of file
chlorine gas soda electrolytic decomposition
\ No newline at end of file
fischer waldheim believing atmospheric electricity aid much in
\ No newline at end of file
growth development plants make following tests
\ No newline at end of file
placed metallic supports number about sixty around each
\ No newline at end of file
hectare acres loam supports provided
\ No newline at end of file
summits electrical accumulators in form crowns surmounted
\ No newline at end of file
teeth collectors united metallic connection
\ No newline at end of file
result culture applied cereals increase crop
\ No newline at end of file
half
\ No newline at end of file
common salt solution chlorine caustic soda
\ No newline at end of file
following experiment also tried metallic plates
\ No newline at end of file
centimeters forty centimeters placed in soil plates
\ No newline at end of file
alternately zinc copper placed about thirty meters
\ No newline at end of file
apart connected two two wire result increase
\ No newline at end of file
twofold fourfold production certain garden plants mr
\ No newline at end of file
fischer says evidently proved electricity aids in
\ No newline at end of file
more complete breaking up soil constituents finally says
\ No newline at end of file
plants thus treated mature more quickly almost always
\ No newline at end of file
perfectly healthy not affected fungoid growth
\ No newline at end of file
on commercial scale
\ No newline at end of file
later n inspired results arrived
\ No newline at end of file
predecessors led investigate influence electricity on
\ No newline at end of file
plants in every stage development results
\ No newline at end of file
experiments most satisfactory practical interest began
\ No newline at end of file
submitting different seeds action an electric current
\ No newline at end of file
find development rendered more rapid complete
\ No newline at end of file
experimented seeds haricot beans sunflowers winter
\ No newline at end of file
spring rye two lots twelve groups one hundred twenty
\ No newline at end of file
seeds each plunged water swelled while wet
\ No newline at end of file
seeds introduced long glass cylinders open both
\ No newline at end of file
ends copper disks pressed seeds disks
\ No newline at end of file
connected poles an induction coil current keep on
\ No newline at end of file
one two minutes immediately afterward seeds sown
\ No newline at end of file
temperature keep fahrenheit
\ No newline at end of file
experiments repeated four times following table shows
\ No newline at end of file
results
\ No newline at end of file
peas beans barley sunflowers
\ No newline at end of file
days days days days
\ No newline at end of file
electrified seeds developed in
\ No newline at end of file
enameled letters manufacture separate
\ No newline at end of file
seeds developed in
\ No newline at end of file
also observed plants coming electrified seeds
\ No newline at end of file
better developed leave much larger color
\ No newline at end of file
brighter in plants growing seeds
\ No newline at end of file
current did not affect yield
\ No newline at end of file
botanical gardens following experiment tried
\ No newline at end of file
large plates zinc copper meter meter
\ No newline at end of file
enameled letters as conducted in london illustrations
\ No newline at end of file
placed in soil connected wires so arranged
\ No newline at end of file
current passed through ground arrangement really
\ No newline at end of file
battery zinc earth copper method applied pot
\ No newline at end of file
herbs flowering plants also growing garden produce
\ No newline at end of file
in latter case result large crop vegetables
\ No newline at end of file
grown enormous size
\ No newline at end of file
extensive experiments in also make
\ No newline at end of file
russia plots earth sown rye corn oats barley peas
\ No newline at end of file
clover flax around respective plots placed insulating
\ No newline at end of file
rods on top latter
\ No newline at end of file
connected means wires atmospheric electricity thus
\ No newline at end of file
collected above seeds latter matured in highly
\ No newline at end of file
electrified atmosphere plots submitted identical
\ No newline at end of file
conditions experiments carry on five years
\ No newline at end of file
results showed considerable increase in yield seed straw
\ No newline at end of file
ripening more rapid barley ripened nearly two weeks
\ No newline at end of file
earlier potatoes grown latter method
\ No newline at end of file
seldom diseased only cent cent
\ No newline at end of file
ordinary culture
\ No newline at end of file
mechanical rubber goods corrugated
\ No newline at end of file
school forestry nancy find experiment
\ No newline at end of file
electrical tension always existing between upper air soil
\ No newline at end of file
stimulated growth find plants protected influence
\ No newline at end of file
less vigorous subject
\ No newline at end of file
also believing passage electricity air
\ No newline at end of file
through vine earth will stimulate growth selected certain
\ No newline at end of file
number vines all same variety all in same condition
\ No newline at end of file
health development sixteen vines submitted experiment
\ No newline at end of file
language english
\ No newline at end of file
matting packing jar production
\ No newline at end of file
sixteen left natural influences in ends vines
\ No newline at end of file
under treatment pointed platinum wires inserted
\ No newline at end of file
attached copper wires leading tops tall poles near
\ No newline at end of file
vines base same vines other platinum wires
\ No newline at end of file
inserted connected copper wires soil close
\ No newline at end of file
experiment began april lasted till september
\ No newline at end of file
wood leave fruit both set vines submitted
\ No newline at end of file
careful analysis following results
\ No newline at end of file
conductor conductor
\ No newline at end of file
moisture cent
\ No newline at end of file
sugar
\ No newline at end of file
tartaric acid
\ No newline at end of file
bitartrate potash
\ No newline at end of file
thus see percentage moisture sugar greater
\ No newline at end of file
undesirable acid lower in vines subject electrical
\ No newline at end of file
influences in left natural conditions there also
\ No newline at end of file
experiments prove beneficial effects electricity on vines
\ No newline at end of file
attacked phylloxera
\ No newline at end of file
following experiments make station several plots
\ No newline at end of file
prepared in greenhouse all had same kind
\ No newline at end of file
soil subjected like influences conditions frames in
\ No newline at end of file
form parallelogram about three feet two feet put
\ No newline at end of file
together across narrow way run copper wires in series
\ No newline at end of file
four nine strands each series separated space about four
\ No newline at end of file
inches wide strands space inch frames
\ No newline at end of file
buried in soil plot little depth so
\ No newline at end of file
roots garden plants set will come in contact wires
\ No newline at end of file
supposition being currents electricity passing along
\ No newline at end of file
wires will decompose its constituents plant food in
\ No newline at end of file
vicinity roots more readily prepare plants two
\ No newline at end of file
electric gardens thus prepared each furnished two common
\ No newline at end of file
battery cells so arranged as allow continuous currents pass
\ No newline at end of file
through each series wires near each electric garden plot
\ No newline at end of file
prepared in same manner save electrical apparatus will
\ No newline at end of file
call two gardens b
\ No newline at end of file
place choose experiments in part greenhouse
\ No newline at end of file
give up largely raising lettuce gardens
\ No newline at end of file
located much trouble mildew had experienced
\ No newline at end of file
reason choice location notice any effect
\ No newline at end of file
electricity mildew disease being as well known
\ No newline at end of file
source much trouble who desire grow early lettuce
\ No newline at end of file
soil carefully prepared material taken pile loam
\ No newline at end of file
commonly use in plant house
\ No newline at end of file
garden located mildew had most detrimental
\ No newline at end of file
experiments began first january closed first april
\ No newline at end of file
garden fifteen lettuce plants head variety
\ No newline at end of file
selected all same size same degree vitality as
\ No newline at end of file
nearly as determine plants set directly over
\ No newline at end of file
wires so roots in contact latter plants
\ No newline at end of file
well watered cared as in ordinary culture fluid
\ No newline at end of file
in battery cells renew time time current
\ No newline at end of file
electricity might not become too feeble close
\ No newline at end of file
experiments following results noted
\ No newline at end of file
five plants died mildew well developed
\ No newline at end of file
heads large largest heads over greatest number wires
\ No newline at end of file
nearest electrodes further noticed healthiest
\ No newline at end of file
largest plants as soon as current became feeble ceased
\ No newline at end of file
altogether began affected mildew on examining roots
\ No newline at end of file
plants find had grown about wires as
\ No newline at end of file
there find greatest amount nourishment roots
\ No newline at end of file
healthy in no way appeared have injured current
\ No newline at end of file
but rather much benefited electrical influences
\ No newline at end of file
living jerboa in zoological garden berlin
\ No newline at end of file
garden prepared another plot same dimensions
\ No newline at end of file
having same kind soil treated in like manner as first
\ No newline at end of file
but electrical apparatus wires wanting close
\ No newline at end of file
experiments only three plants had partially developed two
\ No newline at end of file
nearly destroyed only free
\ No newline at end of file
disease results therefore show healthiest largest
\ No newline at end of file
plants grew in electric plot
\ No newline at end of file
in second experiment call b twenty plants same
\ No newline at end of file
variety lettuce equal size taken treatment give
\ No newline at end of file
same as plants in plot received five plants only
\ No newline at end of file
remained unaffected mildew seven died disease
\ No newline at end of file
half grown rest quite well developed but last
\ No newline at end of file
part experiment began affected several heads large
\ No newline at end of file
largest being over greatest number wires nearest
\ No newline at end of file
electrodes examination roots disclosed same phenomena as
\ No newline at end of file
in
\ No newline at end of file
near plot b also set twenty other plants subjected like
\ No newline at end of file
conditions as first but electricity all but one died
\ No newline at end of file
mildew before half grown solitary plant
\ No newline at end of file
survived being only partly developed close experiment
\ No newline at end of file
even badly affected disease
\ No newline at end of file
considered results in favor electricity
\ No newline at end of file
plants subjected greatest electrical influence hardier
\ No newline at end of file
healthier larger had better color much less affected
\ No newline at end of file
mildew experiments make various grasses
\ No newline at end of file
but no marked results obtained
\ No newline at end of file
like other strangely formed quadrupeds jerboas counted
\ No newline at end of file
question will naturally arise there may not limit
\ No newline at end of file
reached electricity will completely overcome attack
\ No newline at end of file
mildew stimulate plant healthy vigorous condition
\ No newline at end of file
throughout its entire growth fact hardiest
\ No newline at end of file
healthiest largest heads lettuce grew over greatest number
\ No newline at end of file
currents nearest electrodes will seem electricity
\ No newline at end of file
one agents employed nature aid in supplying plant
\ No newline at end of file
nourishment stimulate its growth extent plants
\ No newline at end of file
may submitted electrical influence strength current
\ No newline at end of file
best suited currents prove detrimental
\ No newline at end of file
curiosities animal kingdom as such described in
\ No newline at end of file
development have not determine as yet but desirable
\ No newline at end of file
continue research some definite information shall gained
\ No newline at end of file
on points probably different varieties plants differ greatly
\ No newline at end of file
in capacity enduring action electric currents
\ No newline at end of file
alone must determine
\ No newline at end of file
have proved slow discharge static electricity
\ No newline at end of file
facilitates assimilation nitrogen plants faraday showed
\ No newline at end of file
plants grown in metallic cages around circulated electric
\ No newline at end of file
currents contained cent less organic matter plants grown
\ No newline at end of file
natural history but nevertheless there have never good
\ No newline at end of file
in open air will seem researches latter
\ No newline at end of file
physicist plants requiring large percentage nitrogen
\ No newline at end of file
development will remarkably benefited grown under
\ No newline at end of file
electric agricultural college bulletin no
\ No newline at end of file
very interesting article on influence electricity
\ No newline at end of file
plants illustrated give in supplement present
\ No newline at end of file
results studies prof helsingfors
\ No newline at end of file
exhibition simple reason live jerboas seldom
\ No newline at end of file
treatment rattlesnake bite permanganate potassium
\ No newline at end of file
based on nine successful cases
\ No newline at end of file
amos w barber md cheyenne
\ No newline at end of file
seen in europe as usually die journey hither soon
\ No newline at end of file
footnote governor wyoming
\ No newline at end of file
poisoned wounds inflicted fangs rattlesnake
\ No newline at end of file
happily more rare each year as country becoming more
\ No newline at end of file
populated crotalus rapidly being exterminated yet
\ No newline at end of file
considering recklessness characterizes cow boy in
\ No newline at end of file
treatment reptile astonishing class injury
\ No newline at end of file
not more common thus invariable custom
\ No newline at end of file
cattlemen dismount destroy snakes seen
\ No newline at end of file
after arrival after some hesitation i decide purchase
\ No newline at end of file
readily accomplished slight blow will break back
\ No newline at end of file
blow however generally delivered means quirt
\ No newline at end of file
whip not over two half feet long hence weapon
\ No newline at end of file
bring one who wields in unpleasant proximity fangs
\ No newline at end of file
reptile still more dangerous practice one i have
\ No newline at end of file
frequently seen method playing rattlesnake
\ No newline at end of file
delectation cow boy expense tenderfoot
\ No newline at end of file
well known snake coiled held tail body
\ No newline at end of file
placed length in hole crevice so narrow rendering
\ No newline at end of file
its length sinuous certain amount support give
\ No newline at end of file
pair i happened find mentioned in price list mr c
\ No newline at end of file
strike on theory mounted cow boy first puts rattler
\ No newline at end of file
flight then pushes pony in pursuit stoops saddle
\ No newline at end of file
seize tail give quick upward jerk swinging so
\ No newline at end of file
rapidly around head impossible strike set
\ No newline at end of file
off in pursuit have exhibited most terror sight
\ No newline at end of file
reptile within fair distance hurls snake
\ No newline at end of file
unfortunate victim in full assurance even shall strike
\ No newline at end of file
bury its fangs in flesh impossible
\ No newline at end of file
coil till reaches ground jest i have
\ No newline at end of file
frequently victim have i yet learned appreciate
\ No newline at end of file
as one most interesting specimens obtained
\ No newline at end of file
unalloyed mirth
\ No newline at end of file
belief rattlesnakes always give warning before strike
\ No newline at end of file
not well founded come suddenly often strike first
\ No newline at end of file
disturbed in space so narrow coil formed
\ No newline at end of file
may give no warning presence beyond penetration
\ No newline at end of file
fangs hand foot an intruder one such case i saw
\ No newline at end of file
seems well established snake will not voluntarily
\ No newline at end of file
crawl over hair rope in certain parts country
\ No newline at end of file
expedition south africa year before but i also
\ No newline at end of file
common surround beds such rope
\ No newline at end of file
reptiles seek warmth frequently find under in
\ No newline at end of file
blankets sleep on ground
\ No newline at end of file
after an exceptionally large experience wounds inflicted
\ No newline at end of file
fangs rattlesnake an experience i am glad say
\ No newline at end of file
have most successful in its outcome i think duty add
\ No newline at end of file
practical standpoint testimony as efficacy
\ No newline at end of file
permanganate potassium in treatment class cases
\ No newline at end of file
drug first introduced brazil more
\ No newline at end of file
find sensitiveness delicacy jerboa very trying
\ No newline at end of file
generally use will i believe render comparatively innocuous
\ No newline at end of file
class injury now usually terminates in death
\ No newline at end of file
i make statement as fatality crotalus poison advisedly
\ No newline at end of file
i know belief very common poison rattlesnake
\ No newline at end of file
readily combated full doses whisky fallacious i have
\ No newline at end of file
taken pains investigate number instances cure resulting
\ No newline at end of file
employment free stimulation in each case fangs did
\ No newline at end of file
not penetrate deeply tissues but either scratched over
\ No newline at end of file
surface tore through making wind entrance exit so
\ No newline at end of file
short journey city caused death
\ No newline at end of file
poison least major part not injected
\ No newline at end of file
tissues person struck effect very much same as
\ No newline at end of file
an inexperienced practitioner picks up fold skin
\ No newline at end of file
purpose making hypodermic injection plunges needle
\ No newline at end of file
entirely through forcing medicament wide patient
\ No newline at end of file
nearly all not all cases treated stimulation alone
\ No newline at end of file
have accord experience perished have received
\ No newline at end of file
full dose virus vigorous snake one cases lived
\ No newline at end of file
upward month then perished might considered
\ No newline at end of file
female reduced mate such condition arrived
\ No newline at end of file
chronic symptoms being blood poisoning
\ No newline at end of file
accompanied multiple abscesses another case not occurring in
\ No newline at end of file
own practice died end four days apparently cardiac
\ No newline at end of file
failure active delirium persisted all through case two other
\ No newline at end of file
cases treated stimulants also died symptoms more less
\ No newline at end of file
acute blood poisoning
\ No newline at end of file
feeling almost universal people wyoming
\ No newline at end of file
fair strike rattlesnake certain death free use
\ No newline at end of file
stimulants simply postpones end i do not moment deny
\ No newline at end of file
there seem little hope ever utilized scientific
\ No newline at end of file
strong lusty man may struck fairly rattlesnake
\ No newline at end of file
wind once opened cauterized heart judiciously
\ No newline at end of file
supported may yet recover still fact remains great
\ No newline at end of file
majority cases perish longer shorter interval
\ No newline at end of file
following infliction wind hence any treatment will
\ No newline at end of file
save even majority such cases distinct gain one
\ No newline at end of file
have saved every one nine cases have applied needs
\ No newline at end of file
no further commendation
\ No newline at end of file
first case rattlesnake wind i call occurred in
\ No newline at end of file
research artistic life studies
\ No newline at end of file
cow boy bitten on foot fang penetrating through
\ No newline at end of file
boot bring forty miles fort i
\ No newline at end of file
then stationed i saw about hours after struck
\ No newline at end of file
there an enormous swelling extending up knee whole
\ No newline at end of file
limb bronzed in appearance there no special discoloration
\ No newline at end of file
about wind in fact swelling disguised such an
\ No newline at end of file
extent impossible determine exactly fangs had
\ No newline at end of file
enter pulse scarcely perceptible wrist heart
\ No newline at end of file
beating excessive rapidity patient suffering great
\ No newline at end of file
pain mind clear but oppressed dreadful
\ No newline at end of file
anxiety up time i saw had received absolutely no
\ No newline at end of file
treatment excepting application cactus poultice leg
\ No newline at end of file
there no whisky ranch wounded i once
\ No newline at end of file
make free incisions five six in number one two inches in
\ No newline at end of file
depth about three inches in length cuts gave very
\ No newline at end of file
little pain there much bleeding though there an enormous
\ No newline at end of file
amount serous oozing wounds poured fifteen
\ No newline at end of file
cent solution permanganate potassium fully half an hour
\ No newline at end of file
devoted kneading drug tissues in addition i make
\ No newline at end of file
many hypodermic injections all portions swollen tissue
\ No newline at end of file
illustration jerboa in zoological garden
\ No newline at end of file
but particularly about wind there no very distinct
\ No newline at end of file
line between swollen healthy tissue i did not
\ No newline at end of file
as in other cases endeavor prevent extension cellular
\ No newline at end of file
involvement complete circle hypodermic injections i employed
\ No newline at end of file
in all about forty grains permanganate in addition
\ No newline at end of file
local treatment i pushed stimulation employing carbonate ammonium
\ No newline at end of file
whisky means diuretics laxatives kidneys bowels
\ No newline at end of file
encouraged eliminate as much poison as possible
\ No newline at end of file
patient went on uninterrupted recovery wind healed
\ No newline at end of file
life g
\ No newline at end of file
very little sloughing patient returned work in about
\ No newline at end of file
month cure case regarded cow boys as most
\ No newline at end of file
exceptional in experience similar cases even though
\ No newline at end of file
very freely stimulated had not recovered
\ No newline at end of file
some time later i call see girl age who struck
\ No newline at end of file
rattlesnake miles fort there some
\ No newline at end of file
trouble about procuring relays i compelled ride same
\ No newline at end of file
horse all way out took little short five hours
\ No newline at end of file
together time consumed in sending me word caused an interval
\ No newline at end of file
about twenty hours between infliction injury
\ No newline at end of file
time i saw patient i find fangs had enter on either side
\ No newline at end of file
distal joint middle metacarpal bone arm
\ No newline at end of file
enormously swollen almost axilla exhibited bronzed
\ No newline at end of file
discoloration especially marked about wind along
\ No newline at end of file
course swollen area boggy
\ No newline at end of file
touch exhibited distinct line between
\ No newline at end of file
healthy diseased tissues excepting along course
\ No newline at end of file
brachial vessels indurated discolored area extended as
\ No newline at end of file
broad band distinctly
\ No newline at end of file
anticipation pleasure changed vexation grief
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment