airsun-book

Link of the zip file:https://drive.google.com/file/d/1vK9PlB3Dhnp6-Pvgipe16i5Mij0k40fH/view?usp=sharing

Link of the sample chapter: https://drive.google.com/file/d/1wINmM0CPXhITyv4fDxDD3slvJv1umwXm/view?usp=sharing

Title: Value of Advertisements

Short Description: In today's industry, advertising is actually much less effective than people have historically thought. This work, by using the AFINN ranking of words, challenges the traditional value of advertisement and its effect in building product's quality image.

Long Description: In today's industry, advertising is actually much less effective than people have historically thought. A research paper "The effect of advertising on brand awareness and perceived quality: An empirical investigation using panel data" done by C.R. Clark, Ulrich Doraszelski (University of Pennsylvania), and Michaela Draganska, establishes the finding that advertising has "no significant effect on perceived quality" of a brand. The use of advertisement does build a significant positive effect on brand awareness, but details in the advertisement do not change people's quality perception. Therefore, looking at the most recent products by Apple, an experiment of changing the advertisements from its official website with different descriptive words (all positive, but differs in the levels of positivity) is conducted. Through the process, I am wondering about the differences between the randomly generated results and the original transcript. From the generated advertisement, will people really pay attention to new descriptive words? If so, to what extent? If not, then I am curious about whether computing generated word will be able to replace the traditional advertisement.

To discover this effect, I first copied down and cleaned the set of advertisements from Apple's official websites. Then, I categorized the list of AFINN ranking of words by the level of positivity and part of speech (noun/verb/adj/adv). After that, I replaced descriptive words from the original ads with the AFINN ranking word with the proper capitalization and punctuation to make things "make sense". An example of advertisements for iPhone Xs:

Here is an example of the advertisement for the AirPods:

Moreover, to make the advertisement resembles Apple's actual advertisement, I studied typography, the choice of images, layout and color scheme of their official website. From one of their advertisement videos, I got photos that represent the product and randomly assigned them to each advertisement.

Here are some inspirational layout and photos used for designing the final pages:

I found that most sentences are overlayed on a picture. Therefore, I started to find pictures that Apple often uses.

Embedded Code:

var rhymes, word, data;
 
var afinn;
 
function preload() {
  afinn = loadJSON('afinn111.json');
  script = loadJSON('description.json');
}
 
 
var detect_words = [];
var detect_values = [];
var currentlevel;
//for general category
var pos_verbs = [];
var neg_verbs = [];
var pos_adj = [];
var neg_adj = [];
var pos_adv = [];
var neg_adv = [];
//for high category
var pos_adj_high = [];
var pos_adv_high = [];
var pos_verbs_high = [];
//for low category 
var pos_adj_low = [];
var pos_adv_low = [];
var pos_verbs_low = [];
 
var original_ary1 = [];
var original_ary2 = [];
var original_ad;
var original_ad_ary;
var output = [];
var output1 = [];
var output2 = [];
var currentT1 = [];
var currentT2 = [];
var currentT3 = [];
var currentT4 = [];
var currentT5 = [];
var currentT6 = [];
var currentT7 = [];
var currentT8 = [];
var currentT9 = [];
var phonecontent;
var imagecontent;
// var page = {phone: phonecontent, image: imagecontent}
// var page2 = {phone: phonecontent, image: imagecontent}
// var page3 = {phone: phonecontent, image: imagecontent}
var final_array = [];
 
 
//creating the larger 2d array
var pagearray1 = [];
var pagearray2 = [];
 
 
 
function setup(){
  createCanvas(800, 1000);
  fill(255);
  textFont("Georgia");
 
  var txt = afinn;
  var currentWord;
 
  detect_words = Object.getOwnPropertyNames(txt);
 	detect_values = Object.values(txt);
//AirPods
//IphoneXs
  original_ary1 = script.IphoneXs;
  //print(original_ary1)
  produceP(original_ary1, pagearray1);
  //original_ary2 = script.AirPods;
  //produceP(original_ary2, pagearray2);
  print("array1", pagearray1)
  //print("array2", pagearray2)
 
}
 
function produceP(original_ary, pagearray){
  //print(original_ary)
  //this for loop is used to get the positive and negative verbs for the advertisement
  for (var i = 0; i < detect_values.length; i ++){ currentWord = detect_words [i].replace(/\s+/g, ''); if (detect_values[i] > 0){
      if (RiTa.isVerb(currentWord)) {
      	pos_verbs.push(currentWord)
    	} 
      if (RiTa.isAdjective(currentWord)){
        pos_adj.push(currentWord)
      }
      if (RiTa.isAdverb(currentWord)){
        pos_adv.push(currentWord)
      }
    } if  (detect_values[i] <= 5 && detect_values[i] >= 3){
      if (RiTa.isVerb(currentWord)) {
      	pos_verbs_high.push(currentWord)
    	} 
      if (RiTa.isAdjective(currentWord)){
        pos_adj_high.push(currentWord)
      }
      if (RiTa.isAdverb(currentWord)){
        pos_adv_high.push(currentWord)
      }
    } if  (detect_values[i] < 3 && detect_values[i] >= 0){
      if (RiTa.isVerb(currentWord)) {
      	pos_verbs_low.push(currentWord)
    	} 
      if (RiTa.isAdjective(currentWord)){
        pos_adj_low.push(currentWord)
      }
      if (RiTa.isAdverb(currentWord)){
        pos_adv_low.push(currentWord)
      }
    }
  }
 
  // print("verbs", pos_verbs_5)
  // print("adj", pos_adj_5)
  // print("adv",pos_adv_5)
 
////////////////generating positivity words in general////////////
	for (var t = 0; t < original_ary.length; t++){
    var newstring =new RiString (original_ary[t])
    var posset = newstring.pos()
    var wordset = newstring.words()
    var original_ad_ary = original_ary[t].match(/\w+|\s+|[^\s\w]+/g)
    var current_content = "";
    for (var j = 0; j < posset.length; j++){ // if the word is a verb if (/vb.*/.test(posset[j])){ // if the word is not is/are/be if (wordset[j] != "is" && wordset[j] != "are" && wordset[j] != "be"){ //running for all positive word var newverb = round(random(0, pos_verbs.length-1)); var track; if (j>=2){
            if (wordset[j-1] == "." ){
              track = pos_verbs[str(newverb)][0].toUpperCase()+pos_verbs[str(newverb)].slice(1);
            }else{
              track = pos_verbs[str(newverb)];
            }
          }else{
            if (j==0){
            	track = pos_verbs[str(newverb)][0].toUpperCase()+pos_verbs[str(newverb)].slice(1);
            }else{
            	track = pos_verbs[str(newverb)];
            }
          }
          current_content += track;
        }else if (wordset[j] == "is"){
          current_content += "is";
        }else if (wordset[j] == "are"){
          current_content += "are";
        }else{
          current_content += "be";
        }
      }else{
        if (/jj.*/.test(posset[j])){
          var newadj = round(random(0, pos_adj.length-1));
          var track2;
          if (j>=2){
            if (wordset[j-1] == "." ){
              track2 = pos_adj[str(newadj)][0].toUpperCase()+pos_adj[str(newadj)].slice(1);
            }else{
              track2 = pos_adj[str(newadj)];
            }
          }else{
            if (j==0){
            	track2 = pos_adj[str(newadj)][0].toUpperCase()+pos_adj[str(newadj)].slice(1);
            }else{
            	track2 = pos_adj[str(newadj)];
            }
          }
          current_content += track2;
        } else if (/rb.*/.test(posset[j])){
          var newadv = round(random(0, pos_adv.length-1));
          var track3;
          if (j>=2){
            if (wordset[j-1] == "." ){
              track3 = pos_adv[str(newadv)][0].toUpperCase()+pos_adv[str(newadv)].slice(1);
            }else{
              track3 = pos_adv[str(newadv)];
            }
          }else{
            if (j==0){
            	track3 = pos_adv[str(newadv)][0].toUpperCase()+pos_adv[str(newadv)].slice(1);
            }else{
            	track3 = pos_adv[str(newadv)];
            }
          }
          current_content += track3;
        }else{
          current_content += wordset[j];
        }
      }
      if (wordset[j+1] != "." && wordset[j+1] != "!" && wordset[j+1] != "," && wordset[j+1] != "?"){
      	current_content += " ";
      }
    }
    output.push(current_content);
    if (t<2) { currentT1.push(current_content) }else if (t>=2 && t<4){
      currentT2.push(current_content)
    }else{
      currentT3.push(current_content)
    }
  }
  append(pagearray, output);
 
////////////////generating high positivity words////////////
for (var t1 = 0; t1 < original_ary.length; t1++){
    lexicon = new RiLexicon();
    var newstring1 =new RiString (original_ary[t1])
    var posset1 = newstring1.pos()
    var wordset1 = newstring1.words()
    var current_content1 = "";
    for (var j1 = 0; j1 < posset1.length; j1++){ // getting the positive adj,adv,verbs //print("1", wordset1[j1]) // if the word is a verb if (/vb.*/.test(posset1[j1])){ //print("4",wordset1[j1]) // if the word is not is/are/be if (wordset1[j1] != "is" && wordset1[j1] != "are" && wordset1[j1] != "be"){ //print("**", wordset1[j1]) //running for all positive word var newverb1 = round(random(0, pos_verbs_high.length-1)); var trackb1; if (j1>=2){
            //print("***", wordset1[j1], wordset1[j1-1])
            if (wordset1[j1-1] == "." ){
              //print("****", wordset1[j1])
              trackb1 = pos_verbs_high[str(newverb1)][0].toUpperCase()+pos_verbs_high[str(newverb1)].slice(1);
            }else{
              //print("*!", wordset1[j1])
              trackb1 = pos_verbs_high[str(newverb1)];
            }
          }else{
            if (j1==0){
            	trackb1 = pos_verbs_high[str(newverb1)][0].toUpperCase()+pos_verbs_high[str(newverb1)].slice(1);
            }else{
            	trackb1 = pos_verbs_high[str(newverb1)];
            }
          }
          current_content1 += trackb1;
        }else if (wordset1[j1] == "is"){
          current_content1 += "is";
        }else if (wordset1[j1] == "are"){
          current_content1 += "are";
        }else{
          current_content1 += "be";
        }
      }else{
        if (/jj.*/.test(posset1[j1])){
          //print("2",wordset1[j1])
          var newadj1 = round(random(0, pos_adj_high.length-1));
          var trackb2;
          if (j1>=2){
            //print("2*", wordset1[j1], wordset1[j1-1])
            if (wordset1[j1-1] == "." ){
              //print("2**", wordset1[j1])
              trackb2 = pos_adj_high[str(newadj1)][0].toUpperCase()+pos_adj_high[str(newadj1)].slice(1);
            }else{
              //print("2!", wordset1[j1])
              trackb2 = pos_adj_high[str(newadj1)];
            }
          }else{
            if (j1==0){
              trackb2 = pos_adj_high[str(newadj1)][0].toUpperCase()+pos_adj_high[str(newadj1)].slice(1);
            }else{
             trackb2 = pos_adj_high[str(newadj1)];
            }
          }
          current_content1 += trackb2;
        } else if(/rb.*/.test(posset1[j1])){
          //print("3",wordset1[j1])
          var newadv1 = round(random(0, pos_adv_high.length-1));
          var trackb3;
          if (j1>=2){
            //print("3*", wordset1[j1], wordset1[j1-1])
            if (wordset1[j1-1] == "." ){
              //print("3**", wordset1[j1])
              trackb3 = pos_adv_high[str(newadv1)][0].toUpperCase()+pos_adv_high[str(newadv1)].slice(1);
            }else{
              //print("3!", wordset1[j1])
              trackb3 = pos_adv_high[str(newadv1)];
            }
          }else{
            if (j1==0){
              trackb3 = pos_adv_high[str(newadv1)][0].toUpperCase()+pos_adv[str(newadv1)].slice(1);
            }else{
             trackb3 = pos_adv_high[str(newadv1)];
            }
          }
          current_content1 += trackb3;
        }else{
          //print("5",wordset1[j1])
          current_content1 += wordset1[j1];
        } 
      }
      if (wordset1[j1+1] != "." && wordset1[j1+1] != "!" && wordset1[j1+1] != "," && wordset1[j1+1] != "?"){
        current_content1 += " ";
        //print("6",wordset1[j1]);
      }
    }
 
    output1.push(current_content1);
  	if (t1<2) { currentT4.push(current_content1) }else if (t1>=2 && t1<4){
      currentT5.push(current_content1)
    }else{
      currentT6.push(current_content1)
    }
}
 
	append(pagearray, output1);
  //print("arraybig",pagearray);
 
////////////////generating low positivity words////////////
for (var t2 = 0; t2 < original_ary.length; t2++){
    lexicon = new RiLexicon();
    var newstring2 =new RiString (original_ary[t2])
    var posset2 = newstring2.pos()
    var wordset2 = newstring2.words()
    var current_content2 = "";
    for (var j2 = 0; j2 < posset2.length; j2++){ // getting the positive adj,adv,verbs //print("1", wordset2[j2]) // if the word is a verb if (/vb.*/.test(posset2[j2])){ //print("4",wordset2[j2]) // if the word is not is/are/be if (wordset2[j2] != "is" && wordset2[j2] != "are" && wordset2[j2] != "be"){ //print("**", wordset2[j2]) //running for all positive word var newverb2 = round(random(0, pos_verbs_low.length-1)); var trackc1; if (j2>=2){
            //print("***", wordset2[j2], wordset2[j2-1])
            if (wordset2[j2-1] == "." ){
              //print("****", wordset2[j2])
              trackc1 = pos_verbs_low[str(newverb2)][0].toUpperCase()+pos_verbs_low[str(newverb2)].slice(1);
            }else{
              //print("*!", wordset2[j2])
              trackc1 = pos_verbs_low[str(newverb2)];
            }
          }else{
            if (j2==0){
            	trackc1 = pos_verbs_low[str(newverb2)][0].toUpperCase()+pos_verbs_low[str(newverb2)].slice(1);
            }else{
            	trackc1 = pos_verbs_low[str(newverb2)];
            }
          }
          current_content2 += trackc1;
        }else if (wordset2[j2] == "is"){
          current_content2 += "is";
        }else if (wordset2[j2] == "are"){
          current_content2 += "are";
        }else{
          current_content2 += "be";
        }
      }else{
        if (/jj.*/.test(posset2[j2])){
          //print("2",wordset2[j2])
          var newadj2 = round(random(0, pos_adj_low.length-1));
          var trackc2;
          if (j2>=2){
            //print("2*", wordset2[j2], wordset2[j2-1])
            if (wordset2[j2-1] == "." ){
              //print("2**", wordset2[j2])
              trackc2 = pos_adj_low[str(newadj2)][0].toUpperCase()+pos_adj_low[str(newadj2)].slice(1);
            }else{
              //print("2!", wordset2[j2])
              trackc2 = pos_adj_low[str(newadj2)];
            }
          }else{
            if (j2==0){
              trackc2 = pos_adj_low[str(newadj2)][0].toUpperCase()+pos_adj_low[str(newadj2)].slice(1);
            }else{
             trackc2 = pos_adj_low[str(newadj2)];
            }
          }
          current_content2 += trackc2;
        } else if(/rb.*/.test(posset2[j2])){
          //print("3",wordset2[j2])
          var newadv2 = round(random(0, pos_adv_low.length-1));
          var trackc3;
          if (j2>=2){
            //print("3*", wordset2[j2], wordset2[j2-1])
            if (wordset2[j2-1] == "." ){
              //print("3**", wordset2[j2])
              trackc3 = pos_adv_low[str(newadv2)][0].toUpperCase()+pos_adv_low[str(newadv2)].slice(1);
            }else{
              //print("3!", wordset2[j2])
              trackc3 = pos_adv_low[str(newadv2)];
            }
          }else{
            if (j2==0){
              trackc3 = pos_adv_low[str(newadv2)][0].toUpperCase()+pos_adv_low[str(newadv2)].slice(1);
            }else{
             trackc3 = pos_adv_low[str(newadv2)];
            }
          }
          current_content2 += trackc3;
        }else{
          //print("5",wordset2[j2])
          current_content2 += wordset2[j2];
        } 
      }
      if (wordset2[j2+1] != "." && wordset2[j2+1] != "!" && wordset2[j2+1] != "," && wordset2[j2+1] != "?"){
        current_content2 += " ";
        //print("6",wordset2[j2]);
      }
    }
 
    output2.push(current_content2);
  	if (t2<2) { currentT7.push(current_content2) }else if (t2>=2 && t2<4){
      currentT8.push(current_content2)
    }else{
      currentT9.push(current_content2)
    }
}
  //append(pagearray, output2);
  for (var h = 1; h < 10; h++){
    if (h<4){ currentlevel = "Generally Positive" }else if (h>=4 && h < 7){
      currentlevel = "Highly Positive"
    }else {
      currentlevel = "Barely Positive"
    }
    var page = {level: currentlevel, phone: window["currentT"+str(h)], image: str("random"+round(random(1,20))+".jpg")}
    //print(page)
    final_array.push(page);
  }
 
  // print("hi")
  // page1.phone = currentT1;
  // page+str(h).image = str("random"+round(random(1,20))+".jpg")
  // // page2.phone = currentT2;
  // // page2.image = str("random"+round(random(1,20))+".jpg")
  // // page3.phone = currentT3;
  // // page3.image = str("random"+round(random(1,20))+".jpg")
  // final_array.push(page+str(h))
  // // final_array.push(page2)
  // // final_array.push(page3)
  // }
 
 
}
 
function draw()
{
  background(100,0,100);
  textAlign(RIGHT);
  textSize(36);
  //text(output, 280, 40);
 
  textAlign(LEFT);
  textSize(10);
  textLeading(14);
  text(output, 30, 20, 500, 1000);
  text(output1, 30, 220, 500, 1000);
  text(output2, 30, 420, 500, 1000);
 
  createButton('SAVE POEMS BUTTON')
    .position(10, 10)
    .mousePressed(function() {
      saveJSON(final_array, 'test.json');
  });
 
}