Community
    • 登入

    Apply sentence case while typing in markdown files

    已排程 已置頂 已鎖定 已移動 General Discussion
    10 貼文 4 Posters 662 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • shuai-zhouS
      shuai-zhou
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @shuai-zhou
        最後由 編輯

        @shuai-zhou ,

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

        1 條回覆 最後回覆 回覆 引用 0
        • caryptC
          carypt
          最後由 編輯

          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 條回覆 最後回覆 回覆 引用 0
          • PeterJonesP
            PeterJones @carypt
            最後由 編輯

            @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 條回覆 最後回覆 回覆 引用 2
            • EkopalypseE
              Ekopalypse @PeterJones
              最後由 編輯

              @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 條回覆 最後回覆 回覆 引用 1
              • PeterJonesP
                PeterJones @Ekopalypse
                最後由 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 條回覆 最後回覆 回覆 引用 1
                • caryptC
                  carypt @carypt
                  最後由 編輯

                  @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 條回覆 最後回覆 回覆 引用 0
                  • caryptC
                    carypt @carypt
                    最後由 編輯

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

                    1 條回覆 最後回覆 回覆 引用 0
                    • EkopalypseE
                      Ekopalypse @PeterJones
                      最後由 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 條回覆 最後回覆 回覆 引用 0
                      • EkopalypseE
                        Ekopalypse
                        最後由 編輯

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

                        1 條回覆 最後回覆 回覆 引用 1
                        • 第一個貼文
                          最後的貼文
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors