Community
    • Login

    Apply sentence case while typing in markdown files

    Scheduled Pinned Locked Moved General Discussion
    10 Posts 4 Posters 541 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • shuai-zhouS
      shuai-zhou
      last edited by

      I recently have been using Notepad++ for writing markdown (.md) files. I was wondering if there are plugins/workarounds that can automatically apply sentence case while typing? For example, automatically change the first letter right after a period/question mark/exclamation mark, etc to upper case, also capitalize the single letter “i” automatically?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @shuai-zhou
        last edited by

        @shuai-zhou ,

        Sorry, I don’t know of any sentence-casing plugins.

        1 Reply Last reply Reply Quote 0
        • caryptC
          carypt
          last edited by

          you maybe want to run a mistake correction after finishing writing . there lately was this thread https://community.notepad-plus-plus.org/topic/20502/help-coding-text-errors where someone wanted some regex-searches/replaces for his needs .

          PeterJonesP caryptC 2 Replies Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @carypt
            last edited by

            @shuai-zhou

            Just so you know, you were right to assume it would require a plugin to be able to do it. As was explained in the thread that @carypt linked, to do full grammar checking – whether live while writing, as you requested, or after-the-fact as was requested in the other conversation – requires a huge amount of programming. @carypt seems to believe that a series of search-and-replace can sufficiently replicate the power of true grammar-checking software, as evidenced by his regex solution there and suggestion that you try something similar here. I strongly but respectfully disagree. I am reasonably certain that members in this forum could come up with an exception for a grammatically correct construct which would break any regular-expression “solution” to the problem.

            Unless you have very simple sentence structure, I do not recommend trying to solve this problem with after-the-fact regex solutions.

            –
            Peter (who wishes he knew of an open-source grammar-checking library, and had the time and skills to write the plugin to interface with it; unfortunately, none of those conditions is true)

            EkopalypseE 1 Reply Last reply Reply Quote 2
            • EkopalypseE
              Ekopalypse @PeterJones
              last edited by

              @PeterJones said in Apply sentence case while typing in markdown files:

              Peter (who wishes he knew of an open-source grammar-checking library, and had the time and skills to write the plugin to interface with it; unfortunately, none of those conditions is true)

              Eko, who wished that this could be easily negated!!! :-D

              PeterJonesP 1 Reply Last reply Reply Quote 1
              • PeterJonesP
                PeterJones @Ekopalypse
                last edited by PeterJones

                @Ekopalypse said in Apply sentence case while typing in markdown files:

                wished that this could be easily negated

                :-)

                I did a quick search for open source grammar checkers. This site has an API, so that’s promising.
                https://languagetool.org/proofreading-api

                edit: oh, the API costs money. Another article I found said that they have open-source Java software that you can download, so I thought the API was referring to that. I was wrong /edit

                I still haven’t solved the other fundamental problems. ;-)

                EkopalypseE 1 Reply Last reply Reply Quote 1
                • caryptC
                  carypt @carypt
                  last edited by

                  @carypt my try for case correction searches for the string .(dot)_(space)1word-character -> search : (\.)(\s)(\w) and replace with : $1$2\U$3 . this does not consider a new line - new sentence scenario . what it does : the arguments in brackets are replaced by backreferences $ . https://www.regular-expressions.info/refreplacecase.html . maybe try the mark-function in search first .
                  maybe not correct , use with care

                  caryptC 1 Reply Last reply Reply Quote 0
                  • caryptC
                    carypt @carypt
                    last edited by

                    @carypt some characters have to be “escaped” by \ because of restrictions/construction of regex-engine

                    1 Reply Last reply Reply Quote 0
                    • EkopalypseE
                      Ekopalypse @PeterJones
                      last edited by Ekopalypse

                      @PeterJones said in Apply sentence case while typing in markdown files:

                      https://languagetool.org/proofreading-api

                      Still very interesting, I didn’t know that even existed.
                      Arouses my curiosity.
                      Thx for sharing.

                      1 Reply Last reply Reply Quote 0
                      • EkopalypseE
                        Ekopalypse
                        last edited by

                        There also seems to be free stuff here.
                        https://languagetoolplus.com/http-api/#/default

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors