Git Product home page Git Product logo

Comments (7)

benmarwick avatar benmarwick commented on June 8, 2024

Something odd with the addin, I think. I also got that error, but only once, then nothing at all.

What do you get if you run gramr::write_good_ip() in the same session? Running from the console works for me:

> gramr::write_good_ip()
          index    offset         reason
      1     0           2        "so" adds no meaning

Update, my mistake, nope, running from the console also give the error, perhaps due to some of the characters in the text, maybe the <>:

gramr::write_good_ip()
 Show Traceback
 
 Rerun with Debug
 Error in context_eval(join(src), private$context) : 
  TypeError: Object [object Array] has no method 'substr'

from gramr.

benmarwick avatar benmarwick commented on June 8, 2024

Line breaks seem to be the culprit here. If I change the text to this, with no line breaks at all:

so dude This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

then I get

> gramr::write_good_ip()
  index offset                              reason
1     0      2                "so" adds no meaning
2   215      5                 "click" is repeated
3   257     12 "be generated" may be passive voice

Addin gives nothing at all

from gramr.

jasdumas avatar jasdumas commented on June 8, 2024

Oh thats weird behavior - I got the same result as you once I removed the line-break and ran it in the console. I can investigate further. The addins.dcf file references the two different functions in the same file not sure if that could be it 😢

from gramr.

benmarwick avatar benmarwick commented on June 8, 2024

I think we can add untitled_text <- paste0(untitled_text, collapse = " ") into the fn to combine the input text into a character scalar. That seems to solve the substr error for me.

I think we need to have the addins as interactive: true so we can give a msg if there are no problems, not 100% sure about that though

from gramr.

benmarwick avatar benmarwick commented on June 8, 2024

I think #5 will solve this, see how it works for you

from gramr.

jasdumas avatar jasdumas commented on June 8, 2024

#5 worked well! I close this issue out!

from gramr.

benmarwick avatar benmarwick commented on June 8, 2024

whew! thanks!

from gramr.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.