Skip to content

Commit 9573ff8

Browse files
authored
Merge pull request #78 from ldbc/translate-comments
Translate some comments to English
2 parents ab00f6d + 0febb84 commit 9573ff8

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

src/main/java/ldbc/snb/datagen/generator/ClusteringKnowsGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private void createEdgesCommunityCore(ArrayList<Person> persons, Community c) {
463463
if (pI.index_ < other.index_) {
464464
float prob = rand.nextFloat();
465465
if (prob <= c.p_) {
466-
// crear aresta
466+
// create edge
467467
if (Knows.createKnow(rand, persons.get(pI.index_), persons.get(other.index_)))
468468
numCoreCoreEdges++;
469469
else

src/main/java/ldbc/snb/datagen/generator/DatagenParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Linked Data Benchmark Council (http://www.ldbcouncil.org)
4343

4444
public class DatagenParams {
4545

46-
//Files and folders
46+
// Files and folders
4747
public static final String DICTIONARY_DIRECTORY = "/dictionaries/";
4848
public static final String SPARKBENCH_DIRECTORY = "/sparkbench";
4949
public static final String IPZONE_DIRECTORY = "/ipaddrByCountries";

src/main/java/ldbc/snb/datagen/generator/ForumGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public Forum createGroup(RandomGeneratorFarm randomFarm, long forumId, Person pe
104104
language
105105
);
106106

107-
//Set tags of this forum
107+
// Set tags of this forum
108108
forum.tags(interest);
109109

110110

src/main/java/ldbc/snb/datagen/generator/PhotoGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public long createPhotos(RandomGeneratorFarm randomFarm, final Forum album, fina
8484
int popularPlaceId;
8585
PopularPlace popularPlace;
8686
if (randomFarm.get(RandomGeneratorFarm.Aspect.POPULAR).nextDouble() < DatagenParams.probPopularPlaces) {
87-
//Generate photo information from user's popular place
87+
// Generate photo information from user's popular place
8888
int popularIndex = randomFarm.get(RandomGeneratorFarm.Aspect.POPULAR).nextInt(popularPlaces.size());
8989
popularPlaceId = popularPlaces.get(popularIndex);
9090
popularPlace = Dictionaries.popularPlaces.getPopularPlace(album.place(), popularPlaceId);

src/main/java/ldbc/snb/datagen/generator/PostGenerator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ public long createPosts(RandomGeneratorFarm randomFarm, final Forum forum, final
102102
if (postInfo != null) {
103103

104104
String content = "";
105-
106-
// crear properties class para passar
107105
content = this.generator_.generateText(member.person(), postInfo.tags, prop);
108106

109107
int country = member.person().countryId();
@@ -136,7 +134,7 @@ public long createPosts(RandomGeneratorFarm randomFarm, final Forum forum, final
136134
.get(RandomGeneratorFarm.Aspect.NUM_LIKE), forum, post_, Like.LikeType.POST, exporter);
137135
}
138136

139-
//// generate comments
137+
// generate comments
140138
int numComments = randomFarm.get(RandomGeneratorFarm.Aspect.NUM_COMMENT)
141139
.nextInt(DatagenParams.maxNumComments + 1);
142140
postId = commentGenerator_.createComments(randomFarm, forum, post_, numComments, postId, exporter);

src/main/java/ldbc/snb/datagen/generator/TweetGenerator.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,16 @@ public class TweetGenerator extends TextGenerator {
4949
private DistributionKey hashtag;
5050
private DistributionKey sentiment;
5151
private DistributionKey popularword;
52-
//distribution popular,negative, neutral tweets
53-
private DistributionKey lengthsentence; // sentece length and sentences per tweet
52+
// distribution of popular, negative, and neutral tweets
53+
private DistributionKey lengthsentence; // sentence length and sentences per tweet
5454
private DistributionKey lengthtweet;
5555

5656
public TweetGenerator(Random random, TagDictionary tagDic) throws NumberFormatException, IOException {
5757
super(random, tagDic);
58-
//input de fitxers i crea els 4 maps
58+
// load the input files and create 5 maps
5959
hashtag = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/hashtags.csv");
6060
sentiment = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/sentiment.csv");
6161
popularword = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/words.csv");
62-
//proportion = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/sentiment.csv");
6362
lengthsentence = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/sentence_lengths.csv");
6463
lengthtweet = new DistributionKey(DatagenParams.SPARKBENCH_DIRECTORY + "/sentence_count.csv");
6564
}
@@ -72,18 +71,17 @@ protected void load() {
7271
@Override
7372
public String generateText(PersonSummary member, TreeSet<Integer> tags, Properties prop) {
7473
StringBuffer content = null;
75-
//mirar num de frases
74+
// determine the number of sentences
7675
Double numsentences = Double.valueOf(lengthtweet.nextDouble(this.random));
7776
for (int i = 0; i < numsentences; ++i) {
7877
Double numwords = Double.valueOf(lengthsentence.nextDouble(this.random));
79-
// depenen de la distribució de number hashtags per sentence int numhashtags;
80-
//int numhashtags = funciondistribuciohashtags(numwords);
78+
// the number of hashtages depends on the number of words in the
79+
// sentence
8180
int numhashtags = (int) (numwords * 0.4);
8281
for (int j = 0; j < numhashtags; ++j) {
8382
content.append(" " + hashtag.nextDouble(this.random));
8483
}
85-
// depenen de la distribució de number sentiment words per sentence int numhashtags;
86-
//int numsentimentswords = funciondistribuciosentimentswords(numwords);
84+
// the number of sentiment words depends on the number of words in the sentence
8785
int numsentimentswords = (int) (numwords * 0.4);
8886
for (int q = 0; q < numhashtags; ++q) {
8987
content.append(" " + sentiment.nextDouble(this.random));
@@ -92,14 +90,8 @@ public String generateText(PersonSummary member, TreeSet<Integer> tags, Properti
9290
for (int j = 0; j < numwords; ++j) {
9391
content.append(" " + popularword.nextDouble(this.random));
9492
}
95-
9693
}
97-
//per cada frase mirar numero de paraules
98-
//mirar numero de hashtags
99-
content.toString();
10094
return content.toString();
101-
10295
}
10396

104-
10597
}

0 commit comments

Comments
 (0)